Given the class':
public abstract class AbstractEntity { public virtual Guid Id { get; private set; } } public class Entity { public virtual Guid Id { get; private set; } }
And the Info property for the Id property.
When calling the method:
PropertyInfo.GetAccessors()
It returns both the get method and the set method when the class is not abstract (Entity), but only the get method when the class is abstract (AbstractEntity).
Why is this? And is there another way to get the set method from a property with a private set?
source share