Hi musa.demir,
Thanks for your response.
**Have you removed all the migration and generated the new Migration ? **
Note : We are facing this issue only for the foregin key column. I tried again and facing same issue.
Table Class where added the column OEEnumNotificationStatusId
[Table("OESolutionProcessLink")]
public class OESolutionProcessLink : Entity
{
public virtual int OESolutionId { get; set; }
[ForeignKey("OESolutionId")]
public OESolution OESolutionFk { get; set; }
public virtual int OEProcessId { get; set; }
[ForeignKey("OEProcessId")]
public OEProcess OEProcessFk { get; set; }
public virtual int? OEEnumNotificationStatusId { get; set; }
[ForeignKey("OEEnumNotificationStatusId")]
public OEEnumMaster OEEnumNotificationStatusFk { get; set; }
}
Following Migration is Generated When i Change the Encoding to ANSI, i noticed that there are some special characters in the migration for the column OEEnumNotificationStatusId namespace OneEnterprise.iHUB.Migrations { public partial class addedIssueColumn : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<int>( name: "OEEnumNotificationStatusId", table: "OESolutionProcessLink", nullable: true);
migrationBuilder.AddColumn<int>(
name: "OEEnumNotificationStatus​Id​",
table: "OESolutionProcessLink",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_OESolutionProcessLink_OEEnumNotificationStatus​Id​",
table: "OESolutionProcessLink",
column: "OEEnumNotificationStatus​Id​");
migrationBuilder.AddForeignKey(
name: "FK_OESolutionProcessLink_OEEnumMaster_OEEnumNotificationStatus~",
table: "OESolutionProcessLink",
column: "OEEnumNotificationStatus​Id​",
principalTable: "OEEnumMaster",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_OESolutionProcessLink_OEEnumMaster_OEEnumNotificationStatus~",
table: "OESolutionProcessLink");
migrationBuilder.DropIndex(
name: "IX_OESolutionProcessLink_OEEnumNotificationStatus​Id​",
table: "OESolutionProcessLink");
migrationBuilder.DropColumn(
name: "OEEnumNotificationStatusId",
table: "OESolutionProcessLink");
migrationBuilder.DropColumn(
name: "OEEnumNotificationStatus​Id​",
table: "OESolutionProcessLink");
}
}
}
ok.Thanks for your help
Hi ismcagdas,
Thanks for your response.
Out of the two approaches you shared, the first one makes sense to me.
I would like to implement the interface as it is explained in the shared link and instead of saving the log in mongo db, I would like to save the data in ASP.NET Zero database in my own custom OEAuditLog table. This way I will try to achieve saving all the log in single repository.
Let me know your thoughts also, do you think it's feasible?
I also would like to ask you. If you have similar example with the SQL Server.
Thanks, Best Regards
Thanks for your quick response.
We are able to create the new field in AbpAuditLogs table. One thing I have noticed that it also creates one extra field "Discriminator".
We are not able to save the record using auditingHelper.SaveAsync(auditInfo) as it takes the parameter AuditInfo and AuditInfo does not have the Newly added fields. Could you please let us know how can we save the new record (with new fields) through auditingHelper.SaveAsync method.
Although, we have successfully inserted the record in Auditlog using the IRepository<OEAuditLog, long> auditLogRepository, with the Additional field which we have created in AbpAuditLogs table. Please see the below screenshot for your reference.
Now when we are fetching the records using the repository IRepository<AuditLog, long> auditLogRepository, we are getting all the records. However, we are not getting the new fields/value which we have added in this table. Please see the below screenshot for your reference.
If we are fetching the records using the repository IRepository<OEAuditLog, long> auditLogRepository, we are getting only the records which we have inserted using the IRepository<OEAuditLog, long> auditLogRepository. We are not getting all the AbpAuditLog Table records.
Could you please help us, how can we get the all the records with new fields data.
Best Regards
Hi Expert,
Any update for us. Looking forward to hear from you soon. We are stuck due to this issue.
Thanks Ashish
Hi ismcagdas,
Thansks for your reply.
As per the first link we can see the User.cs in the visual studio solution explorer and we can add the fields in AbpUsers table. However, we are unable to find the entity (i.e class) in the visual studio solution explorer for AbpAuditLogs Table.
Could you please help us how can we add new column in AbpAuditLogs Table.
Any help would be much appreciated.
Thanks,
Hi Expert,
I have to add new Column in AbpAuditLog. like APIRequest, APIResponse in the API var auditInfo = new AuditInfo { TenantId = AbpSession.TenantId, UserId = AbpSession.UserId, ImpersonatorUserId = AbpSession.ImpersonatorUserId, ImpersonatorTenantId = AbpSession.ImpersonatorTenantId, ServiceName = typeObject != null ? typeObject.FullName : "", MethodName = methodName, Parameters = paramerters, ExecutionTime = DateTime.Now, CustomData = paramerters, // New Column that needs to be added APIResponse = "", APIRequest ="" }
How can we modify the table. Can you guides us step step process for this.
I want to use this in my method. There is two more property in this
1) Browserinfo
2) ClientIPAddress
How we can add value in thes property dynamically. Called in API Method.
3) Is there any way by which we can Change the datatype of the column (CustomData) ?
Any help will be appreciated.
Thanks
Ashish Mohan
Hi Expert , I have shared the zip in given in the following mailId ([email protected]). Any help will be much appreciated. Waiting for your response.
Thanks Ashish
Hi Experts,
All the public methods and Exceptions are being logged automatically in the AbpAuditLogs Table. Could you please let us know, How can we insert the record programmatically in the AbpAuditLogs Table.
Thanks,
Hi Expert,
I have shared the zip in given in your given mail. Looking forward for help from you .
Thanks Ashish Mohan