假设我有这三个类:
public class ClassA {
public int ID { get; set; }
public string Name { get; set; }
public ClassC ClassC { get; set; }
}
public class ClassB {
public int ID { get; set; }
public string Name { get; set; }
public ClassC ClassC { get; set; }
}
public class ClassC {
public int Data1 { get; set; }
public int Data2 { get; set; }
}
在我的数据库中,我有:
Table A
+------+--------+---------+
| A_ID | A_Name | A_Data1 |
+------+--------+---------+
| | | |
+------+--------+---------+
Table B
+------+--------+---------+
| B_ID | B_Name | B_Data2 |
+------+--------+---------+
| | | |
+------+--------+---------+
如何在映射ClassB时告诉Entity Framework(6.1.3)忽略Data1,在映射classA时忽略Data2?