EF4 : Complex Type
Is to simplify your life which might seem too complex :). Let’s suppose you have a table like,
Now you might want to club all address related field and make one single representation to it. Once you have created the model in your Visual Studio 2010, you may just need to select all the properties and choose the option to create the Complex Type.
Once you have done it, the Model Browser and Model would look like,
Your query to fetch the required data then would look like,
using (var ctx = new TestDBEntities())
var q = from c in ctx.Addresses
foreach (var k in q)