Example #1
0
 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);
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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();
        }
Example #4
0
 internal void InitializeDatabase(DbConnection connection, int commandTimeout, CommandAdapter commandAdapter = null)
 {
     this.connection     = connection;
     this.commandTimeout = commandTimeout;
     this.commandAdapter = commandAdapter ?? new CommandAdapter();
 }