EF Code First prevent property mapping with Fluent API

后端 未结 7 1258
鱼传尺愫
鱼传尺愫 2020-12-29 20:42

I have a class Product and a complex type AddressDetails

public class Product
{
    public Guid Id { get; set; }

    public Addres         


        
7条回答
  •  暖寄归人
    2020-12-29 21:19

    On EF6 you can configure the complex type:

     modelBuilder.Types()
         .Configure(c => c.Ignore(p => p.Country))
    

    That way the property Country will be always ignored.

提交回复
热议问题