Skip to content

Audit.Net as a dedicated API? #501

Answered by thepirat000
cbdg-mitch asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like your SQL table is expecting an EventType column, but you are not configuring the SqlDataProvider to insert that column.

 services.AddSingleton<AuditDataProvider>(new Audit.SqlServer.Providers.SqlDataProvider(config => config
                .ConnectionString(Environment.GetEnvironmentVariable("DBCREDENTIAL"))
                .TableName("Event")
                .IdColumnName("EventId")
                .CustomColumn("EventType", ev => ev.EventType) // <--- Add the missing custom column
                .JsonColumnName("JsonData")));

Replies: 10 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@cbdg-mitch
Comment options

@cbdg-mitch
Comment options

Comment options

You must be logged in to vote
1 reply
@cbdg-mitch
Comment options

Comment options

You must be logged in to vote
2 replies
@cbdg-mitch
Comment options

@cbdg-mitch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@cbdg-mitch
Comment options

@thepirat000
Comment options

@cbdg-mitch
Comment options

@cbdg-mitch
Comment options

@thepirat000
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@cbdg-mitch
Comment options

@thepirat000
Comment options

Answer selected by cbdg-mitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants