Пример #1
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        public Sequence(
            [NotNull] string name,
            [CanBeNull] string schema,
            [NotNull] IModel model,
            ConfigurationSource configurationSource)
        {
            Check.NotEmpty(name, nameof(name));
            Check.NullButNotEmpty(schema, nameof(schema));

            _model  = model;
            Name    = name;
            _schema = schema;
            _configurationSource = configurationSource;
            Builder = new InternalSequenceBuilder(this, ((IConventionModel)model).Builder);
        }
Пример #2
0
        /// <summary>
        ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
        ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
        ///     any release. You should only use it directly in your code with extreme caution and knowing that
        ///     doing so can result in application failures when updating to a new Entity Framework Core release.
        /// </summary>
        public Sequence(
            [NotNull] string name,
            [CanBeNull] string schema,
            [NotNull] IModel model,
            ConfigurationSource configurationSource)
        {
            Check.NotEmpty(name, nameof(name));
            Check.NullButNotEmpty(schema, nameof(schema));

            _model  = model;
            _name   = name;
            _schema = schema;
            _configurationSource = configurationSource;
#pragma warning disable EF1001 // Internal EF Core API usage.
            Builder = new InternalSequenceBuilder(this, ((Model)model).Builder.ModelBuilder);
#pragma warning restore EF1001 // Internal EF Core API usage.
        }
Пример #3
0
        public Sequence([NotNull] IModel model, [NotNull] string annotationName)
        {
            Check.NotNull(model, nameof(model));
            Check.NotEmpty(annotationName, nameof(annotationName));

            _model = model;
            _configurationSource = ConfigurationSource.Explicit;

            var data = SequenceData.Deserialize((string)model[annotationName]);

            Name         = data.Name;
            _schema      = data.Schema;
            _startValue  = data.StartValue;
            _incrementBy = data.IncrementBy;
            _minValue    = data.MinValue;
            _maxValue    = data.MaxValue;
            _clrType     = data.ClrType;
            _isCyclic    = data.IsCyclic;
            Builder      = new InternalSequenceBuilder(this, ((IConventionModel)model).Builder);
        }
Пример #4
0
        public Sequence([NotNull] IModel model, [NotNull] string annotationName)
        {
            Check.NotNull(model, nameof(model));
            Check.NotEmpty(annotationName, nameof(annotationName));

            _model = model;
            _configurationSource = ConfigurationSource.Explicit;

            var data = SequenceData.Deserialize((string)model[annotationName]);

            _name        = data.Name;
            _schema      = data.Schema;
            _startValue  = data.StartValue;
            _incrementBy = data.IncrementBy;
            _minValue    = data.MinValue;
            _maxValue    = data.MaxValue;
            _clrType     = data.ClrType;
            _isCyclic    = data.IsCyclic;
#pragma warning disable EF1001 // Internal EF Core API usage.
            Builder = new InternalSequenceBuilder(this, ((Model)model).Builder.ModelBuilder);
#pragma warning restore EF1001 // Internal EF Core API usage.
        }