src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Constructs a proposed EntitySet name given an EntityType name
/// </summary>
Constructs a proposed EntitySet name given an EntityType name
Constructs a proposed EntitySet name given an EntityType name
internal static string ConstructProposedEntitySetName(IPluralizationService pluralizationService, string entityTypeName)
        {
            if (string.IsNullOrEmpty(entityTypeName))
            {
                return entityTypeName;
            }
            if (pluralizationService == null)
            {
                return entityTypeName + Resources.Model_DefaultEntitySetSuffix;
            }
            if (!char.IsLetterOrDigit(entityTypeName[entityTypeName.Length - 1]))
            {
                return entityTypeName + Resources.Model_DefaultEntitySetSuffix;
            }
            else
            {
                return pluralizationService.Pluralize(entityTypeName);
            }
        }
internal static string ConstructProposedEntitySetName ( IPluralizationService pluralizationService , string entityTypeName ) { if ( string . IsNullOrEmpty ( entityTypeName ) ) { return entityTypeName ; } if ( pluralizationService == null ) { return entityTypeName + Resources . Model_DefaultEntitySetSuffix ; } if ( ! char . IsLetterOrDigit ( entityTypeName [ entityTypeName . Length - 1 ] ) ) { return entityTypeName + Resources . Model_DefaultEntitySetSuffix ; } else { return pluralizationService . Pluralize ( entityTypeName ) ; } }
Constructs a proposed EntitySet name given an EntityType name
Constructs a proposed EntitySet name given an EntityType name
// if entityTypeName is null or empty just return same value // indicates pluralization not needed so just return entityTypeName with "Set" suffix // if entityTypeName ends with a non-alphanumeric character then add "Set" to end // otherwise attempt to pluralize the entityTypeName
pluralizationService
IPluralizationService
entityTypeName
string