protected ObjectMap(CommandAdapter commandAdapter) { this.commandAdapter = commandAdapter; this.Properties = new List <IPropertyMap>(); foreach (var attribute in this.entityType.GetCustomAttributes <ExtendedPropertyAttribute>()) { this.additionalValues.Add(attribute.Name, attribute.Value); } }
public static IObjectMap CreateMap(DatabaseObjectType databaseObjectType, CommandAdapter commandAdapter) { IObjectMap map = null; switch (databaseObjectType) { case DatabaseObjectType.Table: map = new TableMap <T>(commandAdapter); break; case DatabaseObjectType.View: map = new ViewMap <T>(commandAdapter); break; } return(map); }
internal TableMap(CommandAdapter commandAdapter) : base(commandAdapter) { this.ObjectType = DatabaseObjectType.Table; var tableAttribute = this.EntityType.GetCustomAttribute <TableAttribute>(inherit: true); if (tableAttribute != null) { this.Schema = tableAttribute.Schema; this.ObjectName = tableAttribute.Name; } else { this.Schema = String.Empty; this.ObjectName = this.EntityType.Name; } this.FullyQualifiedObjectName = this.GetFullyQualifiedObjectName(); this.AutoMap(); }
internal void InitializeDatabase(DbConnection connection, int commandTimeout, CommandAdapter commandAdapter = null) { this.connection = connection; this.commandTimeout = commandTimeout; this.commandAdapter = commandAdapter ?? new CommandAdapter(); }