ColumnBuilder.Decimal Method (Nullable<Boolean>, Nullable<Byte>, Nullable<Byte>, Nullable<Decimal>, String, String, String, Boolean, IDictionary<String, AnnotationValues>)
Creates a new column definition to store Decimal data. Entity Framework Migrations APIs are not designed to accept input provided by untrusted sources (such as the end user of an application). If input is accepted from such sources it should be validated before being passed to these APIs to protect against SQL injection attacks etc.
Assembly: EntityFramework (in EntityFramework.dll)
[SuppressMessageAttribute("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] [SuppressMessageAttribute("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed")] public ColumnModel Decimal( Nullable<bool> nullable = null, Nullable<byte> precision = null, Nullable<byte> scale = null, Nullable<decimal> defaultValue = null, string defaultValueSql = null, string name = null, string storeType = null, bool identity = false, IDictionary<string, AnnotationValues> annotations = null )
Parameters
- nullable
-
Type:
System.Nullable<Boolean>
Value indicating whether or not the column allows null values.
- precision
-
Type:
System.Nullable<Byte>
The numeric precision of the column.
- scale
-
Type:
System.Nullable<Byte>
The numeric scale of the column.
- defaultValue
-
Type:
System.Nullable<Decimal>
Constant value to use as the default value for this column.
- defaultValueSql
-
Type:
System.String
SQL expression used as the default value for this column.
- name
-
Type:
System.String
The name of the column.
- storeType
-
Type:
System.String
Provider specific data type to use for this column.
- identity
-
Type:
System.Boolean
Value indicating whether or not the database will generate values for this column during insert.
- annotations
-
Type:
System.Collections.Generic.IDictionary<String, AnnotationValues>
Custom annotations usually from the Code First model.
Return Value
Type: System.Data.Entity.Migrations.Model.ColumnModelThe newly constructed column definition.