Beispiel #1
0
        public TableDefinition(Type modelType, string alias, TypeModeling builderModeling)
        {
            ModelType = modelType;
            Alias     = alias;

            var tableName  = modelType.Name;
            var schemaName = builderModeling.DefaultSchema ?? Modeling.DefaultSchema ?? null;

            // First global modeling
            if (Modeling.HasModel(modelType))
            {
                _tableModel = Modeling.GetModel(modelType);
                tableName   = _tableModel.TableName ?? tableName;
                schemaName  = _tableModel.SchemaName ?? schemaName;
            }
            // By the end check builder modeling
            if (builderModeling.HasModel(modelType))
            {
                _builderTableModel = builderModeling.GetModel(modelType);
                tableName          = _builderTableModel.TableName ?? tableName;
                schemaName         = _builderTableModel.SchemaName ?? schemaName;
            }
            TableName  = tableName;
            SchemaName = schemaName;
        }