I have a class that is marked with a special attribute, for example:
public class OrderLine : Entity
{
...
[Parent]
public Order Order { get; set; }
public Address ShippingAddress{ get; set; }
...
}
I want to write a general method where I need to get a property in an entity that is marked with a parent attribute.
Here is my attribute:
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public class ParentAttribute : Attribute
{
}
How do I write this?
source
share