O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reusing a complex type

Creating a new complex type couldn’t be simpler, but I usually want to reuse that type in multiple places in my model, and that’s a little more complicated. Not a lot (particularly now that you know how to use the Mapping Details window), but a little.

The Entity Model Designer doesn’t have intrinsic support for reusing complex types. There’s no “Refactor into existing Complex Type” option, so the easiest way I’ve found to do it is to first refactor to a new type,  and then change the type and mapping properties:

Image

Create a new complex type from the properties you want to map to the existing type (the properties representing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required