Ejemplo n.º 1
0
        /// <summary>
        ///     Sets the <see cref="SqlServerValueGenerationStrategy" /> to use for the property.
        /// </summary>
        /// <param name="property"> The property. </param>
        /// <param name="value"> The strategy to use. </param>
        public static void SetSqlServerValueGenerationStrategy(
            [NotNull] this IMutableProperty property, SqlServerValueGenerationStrategy?value)
        {
            CheckSqlServerValueGenerationStrategy(property, value);

            property.SetOrRemoveAnnotation(SqlServerAnnotationNames.ValueGenerationStrategy, value);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets the number of sequence numbers to be preallocated and stored in memory for faster access.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="numbersToCache">The value to set.</param>
        public static void SetIdentityNumbersToCache([NotNull] this IMutableProperty property, long?numbersToCache)
        {
            var options = IdentitySequenceOptionsData.Get(property);

            options.NumbersToCache = numbersToCache ?? 1;
            property.SetOrRemoveAnnotation(NpgsqlAnnotationNames.IdentityOptions, options.Serialize());
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Sets the <see cref="MySqlValueGenerationStrategy" /> to use for the property.
        /// </summary>
        /// <param name="property"> The property. </param>
        /// <param name="value"> The strategy to use. </param>
        public static void SetValueGenerationStrategy(
            [NotNull] this IMutableProperty property, MySqlValueGenerationStrategy?value)
        {
            CheckValueGenerationStrategy(property, value);

            property.SetOrRemoveAnnotation(MySqlAnnotationNames.ValueGenerationStrategy, value);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Sets the identity maximum value.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="maxValue">The value to set.</param>
        public static void SetIdentityMaxValue([NotNull] this IMutableProperty property, long?maxValue)
        {
            var options = IdentitySequenceOptionsData.Get(property);

            options.MaxValue = maxValue;
            property.SetOrRemoveAnnotation(NpgsqlAnnotationNames.IdentityOptions, options.Serialize());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets whether the identity's sequence is cyclic.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="isCyclic">The value to set.</param>
        public static void SetIdentityIsCyclic([NotNull] this IMutableProperty property, bool?isCyclic)
        {
            var options = IdentitySequenceOptionsData.Get(property);

            options.IsCyclic = isCyclic ?? false;
            property.SetOrRemoveAnnotation(NpgsqlAnnotationNames.IdentityOptions, options.Serialize());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Sets the identity increment value.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="incrementBy">The value to set.</param>
        public static void SetIdentityIncrementBy([NotNull] this IMutableProperty property, long?incrementBy)
        {
            var options = IdentitySequenceOptionsData.Get(property);

            options.IncrementBy = incrementBy ?? 1;
            property.SetOrRemoveAnnotation(NpgsqlAnnotationNames.IdentityOptions, options.Serialize());
        }
        /// <summary>
        /// Sets the <see cref="CharSet"/> in use by the property's column.
        /// </summary>
        /// <param name="property">The property to set the <see cref="CharSet"/> for.</param>
        /// <param name="charSet">The <see cref="CharSet"/> used by the property's column.</param>
        public static void SetCharSet([NotNull] this IMutableProperty property, CharSet charSet)
        {
            if (charSet != null &&
                !property.IsUnicode().HasValue)
            {
                property.SetIsUnicode(charSet.IsUnicode);
            }

            property.SetOrRemoveAnnotation(MySqlAnnotationNames.CharSet, charSet);
        }
Ejemplo n.º 8
0
 /// <summary>
 ///     Sets the identity seed.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="seed"> The value to set. </param>
 public static void SetIdentitySeed([NotNull] this IMutableProperty property, int?seed)
 => property.SetOrRemoveAnnotation(
     SqlServerAnnotationNames.IdentitySeed,
     seed);
 /// <summary>
 ///     Sets the column to which the property is mapped.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="name"> The name to set. </param>
 public static void SetColumnName([NotNull] this IMutableProperty property, [CanBeNull] string name)
 => property.SetOrRemoveAnnotation(
     RelationalAnnotationNames.ColumnName,
     Check.NullButNotEmpty(name, nameof(name)));
 /// <summary>
 ///     Configures a comment to be applied to the column this property is mapped to.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="comment"> The comment for the column. </param>
 public static void SetComment([NotNull] this IMutableProperty property, [CanBeNull] string comment)
 => property.SetOrRemoveAnnotation(RelationalAnnotationNames.Comment, comment);
 /// <summary>
 ///     Sets a flag indicating whether the property as capable of storing only fixed-length data, such as strings.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="fixedLength"> A value indicating whether the property is constrained to fixed length values. </param>
 public static void SetIsFixedLength([NotNull] this IMutableProperty property, bool?fixedLength)
 => property.SetOrRemoveAnnotation(
     RelationalAnnotationNames.IsFixedLength,
     fixedLength);
 /// <summary>
 ///     Sets the object that is used as the default value for the column this property is mapped to.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="value"> The value to set. </param>
 public static void SetDefaultValue([NotNull] this IMutableProperty property, [CanBeNull] object value)
 => property.SetOrRemoveAnnotation(RelationalAnnotationNames.DefaultValue, ConvertDefaultValue(property, value));
 /// <summary>
 ///     Sets whether the value of the computed column this property is mapped to is stored in the database, or calculated when
 ///     it is read.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="value"> The value to set. </param>
 public static void SetComputedColumnIsStored([NotNull] this IMutableProperty property, bool?value)
 => property.SetOrRemoveAnnotation(
     RelationalAnnotationNames.ComputedColumnIsStored,
     value);
Ejemplo n.º 14
0
 /// <summary>
 ///     Sets the dimension to use when creating a column for this property.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="value"> The dimension. </param>
 public static void SetSqliteDimension([NotNull] this IMutableProperty property, [CanBeNull] string value)
 => property.SetOrRemoveAnnotation(SqliteAnnotationNames.Dimension, value);
Ejemplo n.º 15
0
 /// <summary>
 /// Sets the name of the charset in use by the column of the property.
 /// </summary>
 /// <param name="property">The property to set the columns charset for.</param>
 /// <param name="charSet">The name of the charset used for the column of the property.</param>
 public static void SetCharSet([NotNull] this IMutableProperty property, string charSet)
 => property.SetOrRemoveAnnotation(MySqlAnnotationNames.CharSet, charSet);
 public static void SetValueGenerationStrategy(this IMutableProperty property, FbValueGenerationStrategy?value)
 {
     CheckValueGenerationStrategy(property, value);
     property.SetOrRemoveAnnotation(FbAnnotationNames.ValueGenerationStrategy, value);
 }
Ejemplo n.º 17
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 static void SetColumnOrdinal(this IMutableProperty property, int?ordinal)
 => property.SetOrRemoveAnnotation(
     ScaffoldingAnnotationNames.ColumnOrdinal,
     ordinal);
Ejemplo n.º 18
0
 /// <summary>
 ///     Sets the identity increment.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="increment"> The value to set. </param>
 public static void SetIdentityIncrement([NotNull] this IMutableProperty property, int?increment)
 => property.SetOrRemoveAnnotation(
     SqlServerAnnotationNames.IdentityIncrement,
     increment);
Ejemplo n.º 19
0
 /// <summary>
 /// Sets the Spatial Reference System Identifier (SRID) in use by the column of the property.
 /// </summary>
 /// <param name="property">The property to set the columns SRID for.</param>
 /// <param name="srid">The SRID to configure for the property's column.</param>
 public static void SetSpatialReferenceSystem([NotNull] this IMutableProperty property, int?srid)
 => property.SetOrRemoveAnnotation(MySqlAnnotationNames.SpatialReferenceSystemId, srid);
Ejemplo n.º 20
0
 /// <summary>
 ///     Sets the name to use for the hi-lo sequence.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="name"> The sequence name to use. </param>
 public static void SetHiLoSequenceName([NotNull] this IMutableProperty property, [CanBeNull] string name)
 => property.SetOrRemoveAnnotation(
     SqlServerAnnotationNames.HiLoSequenceName,
     Check.NullButNotEmpty(name, nameof(name)));
Ejemplo n.º 21
0
 /// <summary>
 ///     Sets the SRID to use when creating a column for this property.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="value"> The SRID. </param>
 public static void SetSqliteSrid([NotNull] this IMutableProperty property, int?value)
 => property.SetOrRemoveAnnotation(SqliteAnnotationNames.Srid, value);
Ejemplo n.º 22
0
 /// <summary>
 ///     Sets the property name used when targeting Cosmos.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="name"> The name to set. </param>
 public static void SetPropertyName([NotNull] this IMutableProperty property, [CanBeNull] string name)
 => property.SetOrRemoveAnnotation(
     CosmosAnnotationNames.PropertyName,
     name);
Ejemplo n.º 23
0
 /// <summary>
 /// Sets the schema to use for the hi-lo sequence.
 /// </summary>
 /// <param name="property">The property.</param>
 /// <param name="schema">The schema to use.</param>
 public static void SetHiLoSequenceSchema([NotNull] this IMutableProperty property, [CanBeNull] string schema)
 => property.SetOrRemoveAnnotation(
     NpgsqlAnnotationNames.HiLoSequenceSchema,
     Check.NullButNotEmpty(schema, nameof(schema)));
Ejemplo n.º 24
0
 /// <summary>
 /// Sets the name of the collation in use by the column of the property.
 /// </summary>
 /// <param name="property">The property to set the columns collation for.</param>
 /// <param name="collation">The name of the collation used for the column of the property.</param>
 public static void SetCollation([NotNull] this IMutableProperty property, string collation)
 => property.SetOrRemoveAnnotation(MySqlAnnotationNames.Collation, collation);
Ejemplo n.º 25
0
 /// <summary>
 ///     Sets the property name that the property is mapped to when targeting Cosmos.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="name"> The name to set. </param>
 public static void SetJsonPropertyName(this IMutableProperty property, string?name)
 => property.SetOrRemoveAnnotation(
     CosmosAnnotationNames.PropertyName,
     name);
 /// <summary>
 ///     Sets the SQL expression that is used as the computed value for the column this property is mapped to.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="value"> The value to set. </param>
 public static void SetComputedColumnSql([NotNull] this IMutableProperty property, [CanBeNull] string value)
 => property.SetOrRemoveAnnotation(
     RelationalAnnotationNames.ComputedColumnSql,
     Check.NullButNotEmpty(value, nameof(value)));
Ejemplo n.º 27
0
 /// <summary>
 ///     Sets the schema to use for the hi-lo sequence.
 /// </summary>
 /// <param name="property"> The property. </param>
 /// <param name="schema"> The schema to use. </param>
 public static void SetSqlServerHiLoSequenceSchema([NotNull] this IMutableProperty property, string schema)
 => property.SetOrRemoveAnnotation(
     SqlServerAnnotationNames.HiLoSequenceSchema,
     Check.NullButNotEmpty(schema, nameof(schema)));