I have trouble with PostSharp and Entity Framework, because PostSharp generates "backingField" properties for private fields and it EDM model creating is failed. I have tried to use a MulticastAttributeUsageAttribute.AttributeTargets
to restrict it to properties as described here.
But this code:
[NotifyPropertyChanged(), MulticastAttributeUsage(MulticastTargets.Property)]
public abstract class MetrologijaEntityBase
{
public Guid Id { get; set; }
public string ExternalKey { get; set; }
}
and this code
[NotifyPropertyChanged()]
[MulticastAttributeUsage(MulticastTargets.Property)]
public abstract class MetrologijaEntityBase
{
public Guid Id { get; set; }
public string ExternalKey { get; set; }
}
gives the same result as code without MulticastAttributeUsage
attribute - "backingField" properties (with all getters and setters) for private fields are still generated (as it visible in IL Disassambler for my class). MetrologijaEntityBase
is the base class for EF business model entity hierarchy.
What I am doing wrong in this case?