Пример #1
0
        protected sealed override void InitialiseConfig()
        {
            Specification = new SelectStatementSpecification();
            var type               = typeof(TEntity);
            var tables             = Specification.Tables;
            var tableSpecification = new SelectStatementTableSpecification
            {
                EntityType = type, Schema = "dbo", TableName = CustomAttributeHandle.DbTableName <TEntity>()
            };

            tables.Add(tableSpecification);
        }
Пример #2
0
        protected override void AddTableSpecification <T>(
            JoinType joinType,
            string alias       = null,
            string tableName   = null,
            string tableSchema = null)
        {
            ThrowIfTableAlreadyJoined <T>(alias, tableName, tableSchema);
            var tables = Specification.Tables;
            var tableSpecification1 = new SelectStatementTableSpecification
            {
                Alias      = alias,
                EntityType = typeof(T),
                JoinType   = joinType,
                TableName  = string.IsNullOrEmpty(tableName) ? CustomAttributeHandle.DbTableName <T>() : tableName,
                Schema     = string.IsNullOrEmpty(tableSchema)
                    ? CustomAttributeHandle.DbTableSchema <T>()
                    : tableSchema
            };
            var tableSpecification2 = tableSpecification1;

            tables.Add(tableSpecification2);
        }