From 3eabdee9604ad67cdbab7ee35bdfa249402f8831 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 10 Dec 2017 16:46:54 +0200 Subject: Implemented DB Observables Generator CLI for DAL.Observables post build event. Changes DB table FIBER_SYNTHESIS to FIBER_SYNTHESISES to normalize singularization. --- .../ExtensionMethods/StringExtensions.cs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods') diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs index 5699d27a0..3b46ab7cc 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data.Entity.Design.PluralizationServices; using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -49,4 +50,26 @@ public static class StringExtensions { return titleRegEx.Replace(str, " "); } + + /// + /// Singularizes the specified text. + /// + /// The text. + /// + public static String Singularize(this String text) + { + var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); + return serv.Singularize(text); + } + + /// + /// Pluralizes the specified text. + /// + /// The text. + /// + public static String Pluralize(this String text) + { + var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); + return serv.Pluralize(text); + } } -- cgit v1.3.1