UtilJsonApiSerializer.Conventions.Impl.PluralizedCamelCaseTypeConvention.GetResourceTypeFromRepresentationType C# (CSharp) Method

GetResourceTypeFromRepresentationType() public method

public GetResourceTypeFromRepresentationType ( Type resourceType ) : string
resourceType System.Type
return string
        public virtual string GetResourceTypeFromRepresentationType(Type resourceType)
        {
            string name = resourceType.Name;
            name = Pluralize(name);
            name = Camelize(name);
            return name;
        }

Usage Example

        public void Supports_english_singular_single_word_type_name()
        {
            // Arrange
            var convention = new PluralizedCamelCaseTypeConvention();

            // Act
            var name = convention.GetResourceTypeFromRepresentationType(typeof(Author));

            // Assert
            name.ShouldEqual("authors");
        }
All Usage Examples Of UtilJsonApiSerializer.Conventions.Impl.PluralizedCamelCaseTypeConvention::GetResourceTypeFromRepresentationType