diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-10 16:46:54 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-10 16:46:54 +0200 |
| commit | 3eabdee9604ad67cdbab7ee35bdfa249402f8831 (patch) | |
| tree | 430724d34efbab485821b3bbab28bfbe92b6df26 /Software/Visual_Studio/Tango.Core/ExtensionMethods | |
| parent | 8b4e0971171d40844ca1c63591aeb1fbe4add759 (diff) | |
| download | Tango-3eabdee9604ad67cdbab7ee35bdfa249402f8831.tar.gz Tango-3eabdee9604ad67cdbab7ee35bdfa249402f8831.zip | |
Implemented DB Observables Generator CLI for DAL.Observables post build event.
Changes DB table FIBER_SYNTHESIS to FIBER_SYNTHESISES to normalize singularization.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs | 23 |
1 files changed, 23 insertions, 0 deletions
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, " "); } + + /// <summary> + /// Singularizes the specified text. + /// </summary> + /// <param name="text">The text.</param> + /// <returns></returns> + public static String Singularize(this String text) + { + var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); + return serv.Singularize(text); + } + + /// <summary> + /// Pluralizes the specified text. + /// </summary> + /// <param name="text">The text.</param> + /// <returns></returns> + public static String Pluralize(this String text) + { + var serv = PluralizationService.CreateService(new System.Globalization.CultureInfo("en-us")); + return serv.Pluralize(text); + } } |
