PluralizeService.Core 1.0.0.5

Is .Net Core wrapper for class PluralizationService from System.Data.Entity.Design.PluralizationServices

Install-Package PluralizeService.Core -Version 1.0.0.5
dotnet add package PluralizeService.Core --version 1.0.0.5
<PackageReference Include="PluralizeService.Core" Version="1.0.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PluralizeService.Core --version 1.0.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PluralizeService.Core

Is .Net Core wrapper for class PluralizationService from System.Data.Entity.Design.PluralizationServices

Getting Started

  1. Install package Install-Package PluralizeService.Core
  2. Create class PluralizationServiceInstance
    public class PluralizationServiceInstance : IPluralizer
    {
        private static readonly IPluralizationApi Api;
        private static readonly CultureInfo CultureInfo;

        static PluralizationServiceInstance()
        {
            var builder = new PluralizationApiBuilder();
            builder.AddEnglishProvider();

            Api = builder.Build();
            CultureInfo = new CultureInfo("en-US");
        }


        public string Pluralize(string name)
        {
            return Api.Pluralize(name, CultureInfo) ?? name;
        }

        public string Singularize(string name)
        {
            return Api.Singularize(name, CultureInfo) ?? name;
        }
    }
  1. Inject class to service collection
   services.AddSingleton<IPluralizer, PluralizationServiceInstance>();

Happy nice code!

Authors

PluralizeService.Core

Is .Net Core wrapper for class PluralizationService from System.Data.Entity.Design.PluralizationServices

Getting Started

  1. Install package Install-Package PluralizeService.Core
  2. Create class PluralizationServiceInstance
    public class PluralizationServiceInstance : IPluralizer
    {
        private static readonly IPluralizationApi Api;
        private static readonly CultureInfo CultureInfo;

        static PluralizationServiceInstance()
        {
            var builder = new PluralizationApiBuilder();
            builder.AddEnglishProvider();

            Api = builder.Build();
            CultureInfo = new CultureInfo("en-US");
        }


        public string Pluralize(string name)
        {
            return Api.Pluralize(name, CultureInfo) ?? name;
        }

        public string Singularize(string name)
        {
            return Api.Singularize(name, CultureInfo) ?? name;
        }
    }
  1. Inject class to service collection
   services.AddSingleton<IPluralizer, PluralizationServiceInstance>();

Happy nice code!

Authors

  • .NETStandard 2.0

    • No dependencies.

Version History

Version Downloads Last updated
1.0.0.5 17,543 1/15/2018
1.0.0.3 406 12/22/2017
1.0.0 246 3/26/2018
0.7.0.3 255 12/21/2017