Exclude a field/property from the database with Entity Framework 4 & Code-First

后端 未结 4 1038
悲&欢浪女
悲&欢浪女 2020-11-29 04:24

I will like to know that is there a way to exclude some fields from the database? For eg:

public class Employee
{
    public int Id { get; set; }
    public          


        
4条回答
  •  感动是毒
    2020-11-29 05:27

    I know this is an old question but in case anyone (like me) comes to it from search...

    Now it is possible in entity framework 4.3 to do this. You would do it like so:

    builder.Entity().Ignore(e => e.AddressAs);
    

提交回复
热议问题