Common causes of DbContext has been disposed

On several occasions over the last couple of years I've seen the following exception being thrown in web applications that use Entity Framework. Once you know what might cause this issue it becomes quite obvious and easy to fix but for a junior developer or someone who hasn't experienced it…

Data Annotations for EF Generated Classes

Generating classes using entity framework is fairly problem free most of the time but you’ll soon find limitations once you need to add anything extra to these classes. EF generated classes are by default created as partial classes. This gives you the flexibility to create another ‘part’ to the…