public ByteArrayFieldModel(Modeler modeler, SchemaEntityTypeProperty property, string propertyTypeKeyword, IList <SqlTypeParameter> propertyTypeArguments) : base(modeler, property, propertyTypeKeyword, propertyTypeArguments) { switch (propertyTypeKeyword) { case "timestamp": case "rowversion": IsFixedLength = true; MaxLength = property.MaxLengthSpecified ? property.MaxLength : 8; IsRowVersion = true; return; case "binary": IsFixedLength = true; MaxLength = property.MaxLengthSpecified ? property.MaxLength : 1; return; case "varbinary": IsFixedLength = false; MaxLength = property.MaxLengthSpecified ? property.MaxLength : int.MaxValue; if (propertyTypeArguments.All(pt => pt.ConstantValue != SqlTypeParameter.Constant.Max)) { return; } MaxLength = int.MaxValue; return; case "image": IsFixedLength = false; MaxLength = int.MaxValue; return; } /* * this.Property(t => t.RowVersion) * .IsFixedLength() * .HasMaxLength(8) * .IsRowVersion(); */ }
public StringFieldModel(Modeler modeler, SchemaEntityTypeProperty property, string propertyTypeKeyword, IList <SqlTypeParameter> propertyTypeArguments) : base(modeler, property, propertyTypeKeyword, propertyTypeArguments) { switch (propertyTypeKeyword) { case "char": case "nchar": case "text": case "ntext": IsFixedLength = true; MaxLength = property.MaxLengthSpecified ? property.MaxLength : 0; return; case "varchar": case "nvarchar": IsFixedLength = false; MaxLength = property.MaxLengthSpecified ? property.MaxLength : 0; return; } }
public ByteFieldModel(Modeler modeler, SchemaEntityTypeProperty property, string propertyTypeKeyword, IList <SqlTypeParameter> propertyTypeArguments) : base(modeler, property, propertyTypeKeyword, propertyTypeArguments) { }
protected FieldModel(Modeler modeler, SchemaEntityTypeProperty property, string propertyTypeKeyword, IList <SqlTypeParameter> propertyTypeArguments) : base(modeler, property, propertyTypeKeyword, propertyTypeArguments) { FieldType = typeof(T); }