【发布时间】:2011-08-25 19:36:29
【问题描述】:
是否可以在作为 ComplexType 集合的 POCO 中创建属性?
[ComplexType]
public class Attachment
{
public string FileName { get; set; }
public byte[] RawData { get; set; }
public string MimeType { get; set; }
}
public class TestObject
{
public TestObject()
{
Attachments = new List<Attachment>();
}
public virtual ICollection<Attachment> Attachments { get; set; }
}
我觉得这是不可能的……我一直在尽我所能研究它,但在我看来,ComplexTypes 比它们的价值更麻烦,原因有很多。
【问题讨论】:
标签: asp.net-mvc-3 entity-framework-4.1 ef-code-first complextype