public virtual InternalModelBuilder Apply(InternalModelBuilder modelBuilder)
        {
            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.ValueGeneration,
                SqlServerValueGenerationStrategy.Sequence.ToString(),
                ConfigurationSource.Convention);

            var sequence = new Sequence(Sequence.DefaultName) { Model = modelBuilder.Metadata };
            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + RelationalAnnotationNames.Sequence + sequence.Schema + "." + sequence.Name,
                sequence.Serialize(),
                ConfigurationSource.Convention
                );

            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.DefaultSequenceName,
                sequence.Name,
                ConfigurationSource.Convention);

            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.DefaultSequenceSchema,
                sequence.Schema,
                ConfigurationSource.Convention);

            return modelBuilder;
        }
        public virtual InternalModelBuilder Apply(InternalModelBuilder modelBuilder)
        {
            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.ValueGeneration,
                SqlServerValueGenerationStrategy.Sequence.ToString(),
                ConfigurationSource.Convention);

            var sequence = new Sequence(Sequence.DefaultName)
            {
                Model = modelBuilder.Metadata
            };

            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + RelationalAnnotationNames.Sequence + sequence.Schema + "." + sequence.Name,
                sequence.Serialize(),
                ConfigurationSource.Convention
                );

            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.DefaultSequenceName,
                sequence.Name,
                ConfigurationSource.Convention);

            modelBuilder.Annotation(
                SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.DefaultSequenceSchema,
                sequence.Schema,
                ConfigurationSource.Convention);

            return(modelBuilder);
        }
Esempio n. 3
0
 public virtual InternalModelBuilder Apply(InternalModelBuilder modelBuilder)
 {
     modelBuilder.Annotation(
         SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.ValueGenerationStrategy,
         SqlServerIdentityStrategy.IdentityColumn.ToString(),
         ConfigurationSource.Convention);
     return(modelBuilder);
 }
 public virtual InternalModelBuilder Apply(InternalModelBuilder modelBuilder)
 {
     modelBuilder.Annotation(
         SqlServerAnnotationNames.Prefix + SqlServerAnnotationNames.ValueGeneration,
         SqlServerValueGenerationStrategy.Sequence.ToString(),
         ConfigurationSource.Convention);
     return modelBuilder;
 }
 public virtual InternalModelBuilder Apply(InternalModelBuilder modelBuilder)
 {
     modelBuilder.Annotation(
         NpgsqlAnnotationNames.Prefix + NpgsqlAnnotationNames.ValueGeneration,
         NpgsqlValueGenerationStrategy.Sequence.ToString(),
         ConfigurationSource.Convention);
     return(modelBuilder);
 }