I've been working on a small ASP.NET MVC project lately. I've added log4net and configured some basic logging. I haven't set it up for EF. I've wanted to start off with some first entities and a sqlite db. I have been getting the missing column exception from the ef provider. There's a nifty feature in the db context which allows to log all the generated queries and more details on errors/exceptions in EF.
public MyDbContext() : base(ConnectionString)
{
this.Database.Log = input => Debug.WriteLine(input);
}
It's really useful when you want to add some logging quickly to see what's going on underneath.
No comments:
Post a Comment