예제 #1
0
 /// <summary>
 /// Gets the CLR type for database type provided
 /// </summary>
 /// <param name="dbTypeMap">Database type</param>
 /// <returns>Returns a <see cref="System.Type"/> instance that represents an equivalence for <see cref="CatFactory.Mapping.DatabaseTypeMap"/> provided</returns>
 public static Type GetClrType(this DatabaseTypeMap dbTypeMap)
 => dbTypeMap.HasClrFullNameType ? Type.GetType(dbTypeMap.ClrFullNameType) : null;
 /// <summary>
 /// Gets the parent type for database type instance
 /// </summary>
 /// <param name="databaseTypeMap">Database type</param>
 /// <param name="mappings">A sequence with database types</param>
 /// <returns>Returns a <see cref="Type"/> instance that represents an equivalence for <see cref="DatabaseTypeMap"/> instance</returns>
 public static DatabaseTypeMap GetParentType(this DatabaseTypeMap databaseTypeMap, IEnumerable <DatabaseTypeMap> mappings)
 => mappings.FirstOrDefault(item => databaseTypeMap.ParentDatabaseType == item.DatabaseType);