Entity Framework 6.0 Logging and database Operations Interception Introduction Entity Framework 6.0 introduced a new feature called "Logging SQL". While working with Entity Framework, it sends commands or an equivalent SQL query to the database to do a CRUD operation and this command can be intercepted by application code of Entity Framework. How to enable the SQL logging The Database Log property of DbContext can be set to a delegate of any method that accepts a string as the parameter. Using this method, all SQL generated by the current context will be logged. Syntax: public DbContextEntities () : base ( "name=EntitiesConnections" ) { Database.Log = delegate for method which accepts string as parameter; } Example: For instance, if ...
Csharp Naija is a blog that teaches C# programming using a practical guide. C# Nigeria is here to guide interested individual to the world of software Engineering.