Posts

Showing posts from July, 2018

Pluralizing Words in C# (.NET) Using PluralizationService

Today I needed to generate a dynamic page title based on a category name. For example: My Playlists My Libraries My Categories The page receives a categoryID parameter, retrieves the corresponding category object, and then dynamically pluralizes the category name. Using PluralizationService in .NET .NET provides a built-in service for pluralization via System.Data.Entity.Design.PluralizationServices . using System.Data.Entity.Design.PluralizationServices; .... Category category = Category.GetByID(categoryID); PluralizationService ps = PluralizationService.CreateService( new System.Globalization.CultureInfo( "en-GB" )); Page.Title = $"My { ps.Pluralize( category .Name) }" ; ..... Important Note You must add a reference to System.Data.Entity.Design in your project. When to Use This This approach is useful when: Generating dynamic titles Building admin dashboards Creating REST endpoints with plural resource names Displaying catego...

MongoDB Atlas Cloud Cluster Test – Connecting to .NET Successfully

Today I performed an initial test of MongoDB Atlas , the managed MongoDB Cloud Cluster that can run on different cloud providers. The full setup — from cluster creation to a working connection — took roughly one hour. For a managed distributed database platform, that timing is impressive. Environment Setup The goal was simple: Create a MongoDB Atlas cluster Configure network access Create a database user Connect from a .NET application The cluster provisioning itself was straightforward. The UI is clear, and the workflow is linear: project → cluster → security → connection. Connecting MongoDB Atlas to a .NET Application I successfully connected the cluster to a .NET application using the official MongoDB driver. This was particularly satisfying because about half a year ago, in a previous company, we failed to make it work. At the time, the issue seemed complex. Now I know the root cause. It was only an incorrect connection string. No networking issue. No fir...