One of the most popular posts on my blog has been EF6.1 Mapping Between Types & Tables. Someone asked me this week about getting the property/column mapping in addition to the type/table mapping. There isn’t a whole lot to say (other than the code is horrible and this will look a whole lot better in … Continue reading EF6.1 Get Mapping Between Properties and Columns
MetadataWorkspace
EF6.1 Getting Key Properties for an Entity
Today I had a question show up in my inbox about finding the key properties of a given entity type. Searching around I didn’t find a good existing post about this, so here is the code you need. The code provides a couple of simple extension methods to DbContext. Note that the code is somewhat … Continue reading EF6.1 Getting Key Properties for an Entity
EF6.1 Mapping Between Types & Tables
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
EF Code First Mapping Between Types & Tables
Starting in EF6.1 there is an easier way to do this. See my new EF6.1 Mapping Between Types & Tables post for details. Entity Framework includes the MetadataWorkspace which gives you access to the metadata EF keeps about the shape of your model. The problem is that the Mapping section of this – the bit … Continue reading EF Code First Mapping Between Types & Tables