I have a class Product
and a complex type AddressDetails
public class Product
{
public Guid Id { get; set; }
public Addres
Unfortunately the accepted answer doesn't work, not at least with EF6 and especially if the child class is not an entity.
I haven't found any way to do this via fluent API. The only way it works is via data annotations:
public class AddressDetails
{
public string City { get; set; }
[NotMapped]
public string Country { get; set; }
// other properties
}
Note: If you have a situation where Country
should be excluded only when it is part of certain other entity, then you're out of luck with this approach.