Using templates

Image

In the last chapter I walked you through using the DbContext template to change the code that the Entity Model Designer produces. But I don’t want you to just memorize a series of steps, and that’s all you can do if you don’t understand why you’re doing them. So let’s back up now and look at what’s actually going on with this whole template business.

Two things work together to determine the code generated by the Entity Model Designer: the model’s Code Generation Strategy property and the Custom Tool property of the model file.

By default

When you set a code generation item

On Your Own

You don’t really need my help to change ...

Get Fluent Entity Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.