public static ICommonType GetCommonType(this IHasTypes hasTypes, string typeFullName, bool throwExceptionIfNotFound = false) { return((hasTypes.TypeFullNameToTypes.TryGetValue(typeFullName, out var commonTypes) ? commonTypes : Enumerable.Empty <ICommonType>()).SingleOrDefault(throwExceptionIfNotFound, typeFullName)); }
public static IEnumerable <ICommonType> GetInheritanceCommonTypes(this IHasTypes hasTypes, IHasType hasType) { return(hasTypes.GetInheritanceCommonTypes(hasType.Type)); }
public static bool TryGetCommonType(this IHasTypes hasTypes, string typeFullName, out ICommonType foundCommonType) { return((foundCommonType = hasTypes.GetCommonType(typeFullName)) != null); }
public static IEnumerable <ICommonType> GetInheritanceCommonTypes(this IHasTypes hasTypes, Type baseType) { return(hasTypes.Types.Where(type => type.IsInheritedFrom(baseType))); }