Entity Framework automatically not mapped properties in code first

Using entity framework code-first, I have a property.

  • bool isItTrue {get;set;} // this will get mapped (create a column in the DB)
  • [NotMapped] 2. bool isItTrue {get;set;} // this will NOT get mapped

  • bool isItTrue {get {return someIntProperty < 3;}} // this will not get mapped porque why?
  • Now, I realize that it's a calculated field.

    So my question is whether there is a set of rules on what will and will not be mapped to the DB.

    For example, A property will be mapped unless 1) annotated with notmapped OR 2) Fluent API ignored ---- modelBuilder.Entity() .Ignore(p => p.isItTrue); 3) calculated field? No set method? 4) others?

    If question can be improved, please lmk.

    链接地址: http://www.djcxy.com/p/94536.html

    上一篇: 如何推送一个MFMailComposeViewController? (iOS 5)

    下一篇: 实体框架首先不会自动映射代码中的属性