/// <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 FunctionColumnMapping( IProperty property, FunctionColumn column, FunctionMapping viewMapping) : base(property, column, viewMapping) { }
private string GetPropertyNode(FunctionColumn column) { var propertyString = new StringBuilder(); //Attributes Name and Type propertyString.AppendFormat(" <Property Name=\"{0}\" Type=\"{1}\" ", column.PascalName, column.EFSqlCodeType()); //Attribute Nullable propertyString.Append("Nullable=\"" + (column.AllowNull ? "true" : "false") + "\" "); //Attribute MaxLength if (!string.IsNullOrEmpty(column.EFGetCodeMaxLengthString())) { propertyString.AppendFormat("MaxLength=\"{0}\" ", column.EFGetCodeMaxLengthString()); } //Attribute Precision Scale if (column.EFSupportsPrecision()) { propertyString.AppendFormat("Precision=\"{0}\" Scale=\"{1}\" ", column.Length.ToString(), column.Scale); } //Attribute Unicode if (column.EFUnicode().HasValue) { var unicodeString = column.EFUnicode().Value ? "true" : "false"; propertyString.AppendFormat("Unicode=\"{0}\" ", unicodeString); } //Attribute FixedLength if (column.EFIsFixedLength().HasValue) { var isFixedLengthString = column.EFIsFixedLength().Value ? "true" : "false"; propertyString.AppendFormat("FixedLength=\"{0}\" ", isFixedLengthString); } propertyString.Append("/>").AppendLine(); return(propertyString.ToString()); }