EF Core has a well defined set of concepts that can be configured for entity types and properties. Examples include the primary key of an entity, whether a property is required or optional, etc. Aside from these "baked in" concepts, there are metadata annotations that allow additional concepts to be added to the model. For example, the … Continue reading EF Core 1.1: Read Only Entities & Extending Metadata with Annotations
EF Core includes the ability to reverse engineer a model from an existing database - using the Scaffold-DbContext command in Visual Studio, or the dotnet ef dbcontext scaffold command for .NET CLI. For an introduction, see Getting Started with an Existing Database. The Problem The commands mentioned above are designed to be invoked on a … Continue reading EF Core 1.1: Run Reverse Engineer from Code
EF Core - Learn how to extend the reverse engineer services to perform pluralization and singularization when reverse engineering a model from an existing database.
When using an O/RM, poor performing SQL statements are often not discovered until you (or your DBA) find that a particular query is slowing down your database server. At this point, it becomes hard to identify which piece of application code is causing that SQL to be executed. An interceptor to log slow/failed SQL … Continue reading EF6.x Correlating Poor Performing SQL to Application Code
Code First has automatic functionality built in to help you get up and running with a database and warn you when you may have made a mistake that will cause your app to fail. This is generally helpful when you are developing an application – especially when you are new to EF – but when … Continue reading Reducing Code First Database Chatter
A while back I blogged about how to find what table(s) a given entity is mapped to. The solution in that post worked around the fact that the API for accessing this information was internal. In EF6.1 we made the mapping API public, so it’s now a lot easier. The other advantage of this code … Continue reading EF6.1 Mapping Between Types & Tables
I recently posted an EF6 Level 100-200 Talk-in-a-Box to make it easier for folks to present EF6 to their user group, local conference, work colleagues, or anyone who would listen. I also recently put together a more in-depth talk on EF for Building Modern Web Apps day of Azure Week. I just tidied up the … Continue reading EF6/6.1 Level 300-400 Talk-in-a-Box