Public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext)īase.ReaderExecuting(command, interceptionContext) LogInfo( "EFCommandInterceptor.ReaderExecuted", (), command.CommandText) Public override void ReaderExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext)īase.ReaderExecuted(command, interceptionContext) LogInfo( "EFCommandInterceptor.NonQueryExecuting", (), command.CommandText) Public override void NonQueryExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext)īase.NonQueryExecuting(command, interceptionContext) LogInfo( "EFCommandInterceptor.NonQueryExecuted", (), command.CommandText) Public override void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext interceptionContext)īase.NonQueryExecuted(command, interceptionContext) Public class EFCommandInterceptor : DbCommandInterceptor To get this feature in your EF Core, install the Z. NuGet package or run the following command in Package Manager Console. To use command interception in EF Core, you can use Entity Framework Extensions which provides DbCommandInterceptor. Right now, Entity Framework Core still does not have all the features provided in Entity Framework 6 including the command interception. In this article, we will cover how to use the Entity Framework's interception feature directly for logging.EF6 provides a dedicated logging API that can make it easier to do logging.Using this approach, you can capture a lot more information transiently without having to untidy your code.Anytime Entity Framework sends a command to the database this command can be intercepted by application code.The high-level goal for the interception feature is to allow external code to observe and potentially intercept EF operations. UpdateMatched AndOneNotCondition ExpressionĬoalesce Destination OnMergeUpdate ExpressionĮntity Framework Extensions What is Command Interception SynchronizeMatched AndOneNotCondition Expression SynchronizeMatched AndCondition Expression Ignore OnUpdateMatched AndOneNotCondition Expression Ignore OnUpdateMatched AndCondition Expression Ignore OnSynchronizeMatched AndOneNotCondition Expression Ignore OnSynchronizeMatched AndCondition Expression Ignore OnMergeMatched AndOneNotCondition Expression Ignore OnMergeMatched AndCondition Expression Column Synchronize DeleteKey Subset Expression
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |