Пример #1
0
        public static ModelBuilder.EntityBuilderBase <TMetadataBuilder> ToTable <TMetadataBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TMetadataBuilder> builder,
            [NotNull] string tableName,
            [NotNull] string schema)
            where TMetadataBuilder : ModelBuilder.MetadataBuilder <EntityType, TMetadataBuilder>
        {
            Check.NotNull(builder, "builder");
            Check.NotEmpty(tableName, "tableName");
            Check.NotNull(schema, "schema");

            builder.Annotation(Annotations.TableName, tableName);
            builder.Annotation(Annotations.Schema, schema);

            return(builder);
        }
Пример #2
0
        public static ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .ForeignKeysBuilder.ForeignKeyBuilder CascadeDelete <TEntity>(
            [NotNull] this ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .ForeignKeysBuilder.ForeignKeyBuilder foreignKeyBuilder,
            bool cascadeDelete)
            where TEntity : class
        {
            Check.NotNull(foreignKeyBuilder, "foreignKeyBuilder");

            foreignKeyBuilder.Annotation(Annotations.CascadeDelete, cascadeDelete.ToString());

            return(foreignKeyBuilder);
        }
Пример #3
0
        public static ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .PropertiesBuilder.PropertyBuilder ColumnDefaultSql <TEntity>(
            [NotNull] this ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .PropertiesBuilder.PropertyBuilder propertyBuilder,
            [NotNull] string columnDefaultSql)
            where TEntity : class
        {
            Check.NotNull(propertyBuilder, "propertyBuilder");

            propertyBuilder.Annotation(Annotations.ColumnDefaultSql, columnDefaultSql);

            return(propertyBuilder);
        }
Пример #4
0
        public static ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .PropertiesBuilder.PropertyBuilder ColumnType <TEntity>(
            [NotNull] this ModelBuilder.EntityBuilderBase <ModelBuilder.EntityBuilder <TEntity> > .PropertiesBuilder.PropertyBuilder propertyBuilder,
            [NotNull] string typeName)
            where TEntity : class
        {
            Check.NotNull(propertyBuilder, "propertyBuilder");

            propertyBuilder.Annotation(Annotations.StorageTypeName, typeName);

            return(propertyBuilder);
        }
Пример #5
0
        public static ModelBuilder.EntityBuilderBase <TEntityBuilder> .IndexesBuilder.IndexBuilder IsClustered <TEntityBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TEntityBuilder> .IndexesBuilder.IndexBuilder indexesBuilder,
            bool clustered)
            where TEntityBuilder : ModelBuilder.EntityBuilderBase <TEntityBuilder>
        {
            Check.NotNull(indexesBuilder, "indexesBuilder");

            indexesBuilder.Annotation(Annotations.IsClustered, clustered.ToString());

            return(indexesBuilder);
        }
Пример #6
0
        public static ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder ColumnDefaultSql <TEntityBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder propertyBuilder,
            [NotNull] string columnDefaultSql)
            where TEntityBuilder : ModelBuilder.EntityBuilderBase <TEntityBuilder>
        {
            Check.NotNull(propertyBuilder, "propertyBuilder");
            Check.NotNull(columnDefaultSql, "columnDefaultSql");

            propertyBuilder.Annotation(Annotations.ColumnDefaultSql, columnDefaultSql);

            return(propertyBuilder);
        }
Пример #7
0
        public static ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder ColumnType <TEntityBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder propertyBuilder,
            [NotNull] string typeName)
            where TEntityBuilder : ModelBuilder.EntityBuilderBase <TEntityBuilder>
        {
            Check.NotNull(propertyBuilder, "propertyBuilder");
            Check.NotNull(typeName, "typeName");

            propertyBuilder.Annotation(Annotations.StorageTypeName, typeName);

            return(propertyBuilder);
        }
Пример #8
0
        public static ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder ColumnName <TEntityBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TEntityBuilder> .PropertyBuilder propertyBuilder,
            [NotNull] string columnName)
            where TEntityBuilder : ModelBuilder.EntityBuilderBase <TEntityBuilder>
        {
            Check.NotNull(propertyBuilder, "propertyBuilder");
            Check.NotEmpty(columnName, "columnName");

            propertyBuilder.Annotation(Annotations.ColumnName, columnName);

            return(propertyBuilder);
        }
Пример #9
0
        public static ModelBuilder.EntityBuilderBase <TMetadataBuilder> .KeyBuilder KeyName <TMetadataBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TMetadataBuilder> .KeyBuilder builder,
            [NotNull] string keyName)
            where TMetadataBuilder : ModelBuilder.MetadataBuilder <EntityType, TMetadataBuilder>
        {
            Check.NotNull(builder, "builder");
            Check.NotEmpty(keyName, "keyName");

            builder.Annotation(Annotations.KeyName, keyName);

            return(builder);
        }
Пример #10
0
        public static ModelBuilder.EntityBuilderBase <TMetadataBuilder> .IndexesBuilder.IndexBuilder IndexName <TMetadataBuilder>(
            [NotNull] this ModelBuilder.EntityBuilderBase <TMetadataBuilder> .IndexesBuilder.IndexBuilder builder,
            [NotNull] string indexName)
            where TMetadataBuilder : ModelBuilder.MetadataBuilder <EntityType, TMetadataBuilder>
        {
            Check.NotNull(builder, "builder");
            Check.NotEmpty(indexName, "indexName");

            builder.Annotation(Annotations.IndexName, indexName);

            return(builder);
        }