private bool IsSqlServerSpecificType(Type type) { if (MapEmitAssembly.IsSqlServerSpecificType(type) == false) { return(false); } this.HasSqlServerSpecificFields = true; return(true); }
public void MapType() { var properties = typeof(T).GetProperties() .Where(property => MapEmitAssembly.IsValidType(property.PropertyType)); foreach (var propertyInfo in properties) { var allowNulls = propertyInfo.PropertyType.DoesPropertySupportNull(); this.Map(propertyInfo, propertyInfo.Name, allowNulls, null); } }
private void Map(PropertyInfo destinationProperty, string sourceColumn, bool allowNulls, object defaultValue) { CheckDefaultValuePreConditions(destinationProperty, allowNulls, defaultValue); var isSqlServerSpecificType = this.IsSqlServerSpecificType(destinationProperty.PropertyType); MapEmitAssembly.CheckValidType(destinationProperty); var fieldMapDefinition = new FieldMapDefinition( destinationProperty, sourceColumn ?? destinationProperty.Name, allowNulls, defaultValue, isSqlServerSpecificType); this.FieldMapDefinitions[destinationProperty] = fieldMapDefinition; }