1
实体框架能够与模型对象一起工作,该模型对象包含一些在CRUD操作期间应该序列化/反序列化为xml的属性。实体框架中的XML序列
例子:
public class Question
{
public string Text { get; set; }
public List<Answers> Answers { get; set; }
}
public class Answers
{
public string Text { get; set; }
}
当插入我们应该得到以下行中的数据库中的结果:
Text | Answers
_____________________________________________________________________________________
myQuestionText | <answers><answer Text="answer1"/><answer Text="answer2"/></answers>