One of the most useful methods to overide is ReaderExecuted which despite its name actually fires for inserts, updates, deletes (and selects of course) when SaveChanges() is called. You can see the class is abstract and all methods are virtual meaning have to subclass it but can overide only whatever methods are relevant to your use cases. The class structure of DbCommandInterceptor is below (note this is a of 3.1.3 as there have been some method changes since EF Core 3.0). Registering your subclass with your DBContext.Overiding any methods which you want to ‘hook’ into.Creating a subclass of the abstract DbCommandInterceptor class in EF.NET mocking library do you use? August 12, 2023 Use Target Typed New Expressions to infer type on the right in C# 9 + August 13, 2023.Share settings across multiple projects using a file August 13, 2023.How to treat all warnings as compile errors in.Do you use a mocking framework or manually create your mocks? August 13, 2023.7 Cognitive biases influencing our software development decisions August 13, 2023.NET devs moving away from Moq after #moqgate? August 13, 2023 NET developers rely too much on third party libraries from NuGet? August 13, 2023 Please follow me on Twitter and LinkedIn for more.New summary diff view to only see changes now available in Visual Studio August 14, 2023.NuGet 6.7 shows which packages are vulnerable in Visual Studio August 14, 2023.Simple string concatenation using String.Create and other performance sensitive approaches in.NET method usages visible in Visual Studio from 17.6+ August 14, 2023 Entity Framework FromSqlInterpolated examples August 15, 2023.Include sensitive data in Entity Framework logging by setting EnableSensitiveDataLogging August 15, 2023. Entity Framework DB First quick start using EF Core Power Tools August 17, 2023.How to auto include navigations in Entity Framework August 22, 2023.Difference between const and readonly in C# August 22, 2023.How to make strings non-Unicode in Entity Framework Code First August 22, 2023.NET types in Entity Framework August 22, 2023 Setting default global configuration for.NET Developer and Solutions Architect contractor with over 17 years experience obtained across multiple domains and organisations such as Citibank, Central Bank, AIB, ESB, United Drug and RTE.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |