C# Entity Framework 4 または 5 の場合
エンティティ クラス #1
public class ClassOne
{
public string FirstName { get;set; }
}
public class ClassTwo : ClassOne
{
public string LastName get;set; }
}
IQueryable の場合:
return from e in Context.pClassOneList from r in SomeOtherList select new ClassTwo
{
// right here how do I get all the fields assigned without having to do it manually? ie:
FirstName = e.FirstName,
LastName = r.SomeOtherVar // works perfectly, but the whole of ClassOne is not assigned unless I do it manually.
}
ご協力いただきありがとうございます。