public void ForAttribute <TAttribute>(Action <TAttribute> func) where TAttribute : Attribute { if (!HasAttribute <TAttribute>()) { return; } func(AttributeProvider.GetAttribute <TAttribute>()); }
public TValue ForAttribute <TAttribute, TValue>(Func <TAttribute, TValue> callback, TValue defaultValue) where TAttribute : Attribute { if (!HasAttribute <TAttribute>()) { return(defaultValue); } return(callback(AttributeProvider.GetAttribute <TAttribute>())); }
public TAttribute GetAttribute <TAttribute>() where TAttribute : Attribute { return(AttributeProvider.GetAttribute <TAttribute>()); }