Using Complex Types in Entity Framework

A database table represents your application data in row-column format. Although in many cases this row-column structure can be mapped directly to entities, at times you may need to reorganize the same. Consider, for example, the Customers table of Northwind database. The Customers table has Address, City, Region, Country and PostalCode columns representing the address of the company. The entity that represents this table might not be as "flat" as the table. For example, you may wish to have a property - Location - that is of class type and has properties such as Street, City, Region and PostalCode. Luckily, entity framework allows you to do so quite easily. The remainder of this article explains how.

http://www.binaryintellect.net/articles/48e0f502-ee1b-4695-8e3d-c111d4171d1d.aspx

 

No Comments