src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Get entity model property max length facet text.
/// </summary>
/// <param name="columnSize"></param>
/// <returns></returns>
Get entity model property max length facet text.
Get entity model property max length facet text .
internal static string GetMaxLengthFacetText(uint? columnSize)
        {
            if (columnSize == null)
            {
                return String.Empty;
            }
            else if (columnSize >= (Int32.MaxValue / 2))
            {
                return Property.MaxLengthMaxValue;
            }
            else
            {
                return columnSize.ToString();
            }
        }
internal static string GetMaxLengthFacetText ( uint ? columnSize ) { if ( columnSize == null ) { return String . Empty ; } else if ( columnSize >= ( Int32 . MaxValue / 2 ) ) { return Property . MaxLengthMaxValue ; } else { return columnSize . ToString ( ) ; } }
Get entity model property max length facet text.
Get entity model property max length facet text .
// Decide whether to return "Max" or the columnSize parameter value. // Ideally we just need to check if columnSize value is equal to Int32.MaxValue; but unfortunately this does not work for some DB unicode types for example NText. // For NText and other unicode type, if the columnSize is Int32.MaxValue/2, MaxLength should be set to "Max". // I think it is pretty safe to assume if the columnSize >= Int32.MaxValue/2 then set the MaxLength to "Max" since in SQL Server you could not set a column size to be greater than 8000.
None
columnSize
uint?
None