private string GetMappingColumnName(PropertyInfo property, Type modelType) { string mappingColumnName = ""; object attribute = property.GetCustomAttributes(false) .Where(a => a is DBColumnAttribute) .First(); mappingColumnName = ((DBColumnAttribute)attribute).ColumnName; if (mappingColumnName.Equals("Id")) { mappingColumnName = NamingService.GetIdName(modelType); } return(mappingColumnName); }
public BaseRepository() { tableName = NamingService.GetTableNameFromRepository(this.GetType()); idName = NamingService.GetIdName(typeof(T)); }
public ORMExpressionBuilder(Dictionary <Type, MethodInfo> fromDBMethods, Dictionary <Type, MethodInfo> toDBMethods, Type modelType) { idName = NamingService.GetIdName(modelType); fromDBConversionMethods = fromDBMethods; toDBConversionMethods = toDBMethods; }