Пример #1
0
 public static bool IsKnownType(this FullTypeName typeName, KnownTypeCode knownType)
 {
     return(typeName == KnownTypeReference.Get(knownType).TypeName);
 }
Пример #2
0
 internal static bool IsKnownType(this FullTypeName typeName, KnownAttribute knownType)
 {
     return(typeName == knownType.GetTypeName());
 }
Пример #3
0
 /// <summary>
 /// Gets the attribute of the specified attribute type (or derived attribute types).
 /// </summary>
 /// <param name="entity">The entity on which the attributes are declared.</param>
 /// <param name="attributeType">The attribute type to look for.</param>
 /// <param name="inherit">
 /// Specifies whether attributes inherited from base classes and base members (if the given <paramref name="entity"/> in an <c>override</c>)
 /// should be returned. The default is <c>true</c>.
 /// </param>
 /// <returns>
 /// Returns the attribute that was found; or <c>null</c> if none was found.
 /// If inherit is true, an from the entity itself will be returned if possible;
 /// and the base entity will only be searched if none exists.
 /// </returns>
 public static IAttribute GetAttribute(this IEntity entity, FullTypeName attributeType, bool inherit = true)
 {
     return(GetAttributes(entity, attributeType, inherit).FirstOrDefault());
 }