Class UniqueAttributeExtensions
- Namespace
- Cratis.Chronicle.Events.Constraints
- Assembly
- Cratis.Chronicle.dll
Extension methods for working with UniqueAttribute.
public static class UniqueAttributeExtensions
- Inheritance
-
UniqueAttributeExtensions
- Inherited Members
Methods
GetConstraintMessage(MemberInfo)
Get the constraint message for a type adorned with UniqueAttribute, defaults to type name if not explicitly defined.
public static ConstraintViolationMessage GetConstraintMessage(this MemberInfo member)
Parameters
memberMemberInfoType to get for that has UniqueAttribute.
Returns
- ConstraintViolationMessage
Message for constraint, if defined, default if not.
GetConstraintName(MemberInfo)
Get the constraint name for a type adorned with UniqueAttribute, defaults to type name if not explicitly defined.
public static ConstraintName GetConstraintName(this MemberInfo member)
Parameters
memberMemberInfoType to get for that has UniqueAttribute.
Returns
- ConstraintName
Name of constraint.
GetRemoveConstraints(Type)
Get all RemoveConstraintAttribute instances applied to an event type.
public static IEnumerable<RemoveConstraintAttribute> GetRemoveConstraints(this Type type)
Parameters
typeTypeEvent type to inspect.
Returns
- IEnumerable<RemoveConstraintAttribute>
All RemoveConstraintAttribute instances on the type.