public void FluentMapper_Initialize_Should_Add_Dapper_TypeMap() { PreTest(); FluentMapper.Intialize(c => c.AddMap(new MapWithOnePropertyMap())); SqlMapper.ITypeMap typeMap = SqlMapper.GetTypeMap(typeof(TestEntity)); Assert.IsNotNull(typeMap, "TypeMap is null."); }
public static void Initialize(string @namespace) { IEnumerable <Type> types = from assem in AppDomain.CurrentDomain.GetAssemblies().ToList() from type in assem.GetTypes() where type.IsClass && type.Namespace == @namespace select type; types.ToList().ForEach(type => { SqlMapper.ITypeMap mapper = (SqlMapper.ITypeMap)Activator .CreateInstance(typeof(ColumnAttributeTypeMapper <>) .MakeGenericType(type)); SqlMapper.SetTypeMap(type, mapper); }); }
private static void AdaptToFastCrud(EntityMapping <TEntity> mapping, SqlMapper.ITypeMap entityMap) { var currentConventions = OrmConfiguration.Conventions; foreach (var propDescriptor in _propertyDescriptors) { var entityMember = entityMap.GetMember(propDescriptor.Name); var propMapping = mapping .SetPropertyByMapping(new PropertyMapping(mapping, propDescriptor)); if (entityMember != null) { propMapping.DatabaseColumnName = entityMember.ColumnName; } currentConventions.ConfigureEntityPropertyMapping(propMapping); } }
public CustomTypeMap(Type type, SqlMapper.ITypeMap tail) { this.Type = type; this._tail = tail; }
public ColumnTypeMapper(Type type) { _internalMapper = new CustomPropertyTypeMap(type, _propertyResolver); }
public CustomTypeMap(SqlMapper.ITypeMap innerTypeMap) { _innerTypeMap = innerTypeMap; _properties = new Dictionary <string, SqlMapper.IMemberMap>(StringComparer.OrdinalIgnoreCase); }
public CustomTypeMap(SqlMapper.ITypeMap implSourceMap, SqlMapper.ITypeMap interfaceSourceMap) { _implSourceMap = implSourceMap; _interfaceSourceMap = interfaceSourceMap; }
private MapeadorPrefixoColunas(Type tipo, params String[] prefixos) { this.mapeadorBase = new DefaultTypeMap(tipo); this.prefixos = prefixos; }
public DapperTypeMapper(Type type) { _internalMapper = new CustomPropertyTypeMap(type, _propertyResolver); }
public CustomTypeMap() { type = typeof(T); tail = SqlMapper.GetTypeMap(typeof(T)); }