Entity Framework

Postings regarding the development, management, or configuration of Microsoft's Entity Framework ORM tool.

October 17, 2017

Confronting Your Entity Framework Performance Fears

This morning I was supposed to speak at DevUp in St. Louis, sadly due to a dead airplane battery I couldn't get myself down there in time. Although not as good as being able to be there in person, I wanted to make at least an effort to share the presentation materials, and code samples with everyone as this topic made for a very popular session at other events. So let us dive in!

September 05, 2017

Taking Control of ASP.NET Identity Table Names

If you are like me, I love the power, and ease of use that comes with ASP.NET Identity. However, I find that the naming conventions for model objects related to identity do not necessarily meet the standards that I would like to use in my applications. As such, I find it necessary to take control of these names and work to standardize my projects, and this post explores this process.

August 25, 2017

Entity Framework Core & Complex Projects

For those migrating to Entity Framework Core (EFCore) the online documentation is very helpful for the most basic of projects. However, as you work to create more complex applications, things can get more complicated. One area I have witnessed being a concern is how to manage the extraction of your EFCore or Identity DBContext into a reusable project. This post will look at this process, and the steps necessary to properly manage interactions with migrations.

February 24, 2017

Take Control of Code Coverage Analysis with Exclusions

As developers Unit Testing makes our jobs easier, we have consistent tests to validate our work, change management becomes easier, and we can prove the functionality remains the same. In collaboration with various companies, however, I find that often the tooling gets in the way of developers understanding exactly how much of their important code is covered by unit tests. Visual Studio provides unit test coverage tools for reporting, yet often the tool ends up discouraging users due to a lower than expected rate of coverage. In this post, we will investigate a few common areas that can impact your unit test coverage, and how to prevent certain items from changing the reported coverage percentage.

January 25, 2017

Using Entity Framework with Legacy Databases

I find more people are interested in getting started with Entity Framework within their organizations. However, the various documentation and examples that exist don't necessarily give the best overall implementation solutions. I have worked with many people that have thought "we have a legacy database setup, we can't use entity framework" or "we cannot use migrations, so we can't use code first." Both are very common misconceptions, but something that isn't the case. It just takes a bit of work. In this post, we will dive into the specifics of implementing Entity Framework to a legacy database, where we cannot rename tables and other objects without substantial effort. A link to full code will be provided at the bottom.

October 08, 2015

Handing Namespace and Class Changes in Entity Framework

Entity Framework is an amazing set of tooling that helps to manage data access in an efficient manner, however, it seems that when things start to go "funny" it can be a major time-suck.  A recent issue that I experienced that I thought would be worth sharing was an issue related to applying migrations.  Adding migrations is something that has become trivial, yet one day my project reported Unable to generate an explicit migration because the following explicit migrations are pending:.... With every single one of my existing migrations listed.  This was highly curious, as the application has been in use, in production, for the better part of a few months.

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.