Megosztás a következőn keresztül:


Extending Entity Framework Generated Types

The Entity Framework can generate code that contains entity type definition classes. The classes only contain properties that are defined in the conceptual model and do not contain any methods. The generated classes are partial. For more information, see Partial (Visual Basic) or partial (C# Reference). Having partial classes enables you to extend these classes by using custom methods and properties in a separate source file without having to worry about losing your customization when the generated files are refreshed. For more information, see How to: Customize Generated Data Objects. You should also consider using text templates with the ADO.NET Entity Data Model Designer to customize generated data classes. For more information, see How to: Customize Object Layer Code Generation.

See Also

Concepts

Customizing Objects
Defining Business Logic
Working with Objects

Other Resources

Entity Data Model Tools