Actually haven’t found the answer for this one.
What for and why do i need a complex type in ef4?
Please give a code example in c# it will be more than appreciated.
Thank you very much in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some information might be better suited to fit into a complex type. For example given that you have a product type, which contains some information about it’s width, height and depth. You could create a property/column for each one of them. Or just create a single property using a complex-type which is mapped to multiple columns:
Your ´Products´ table might actually look like this: Id, Name, Width, Height, Depth; but you get a much nicer object.
Also complex-types can be used to solve some problems with the EF and custom user types. But I won’t get into that now.