aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Core/ExtensionMethods
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-10 16:46:54 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-10 16:46:54 +0200
commit3eabdee9604ad67cdbab7ee35bdfa249402f8831 (patch)
tree430724d34efbab485821b3bbab28bfbe92b6df26 /Software/Visual_Studio/Tango.Core/ExtensionMethods
parent8b4e0971171d40844ca1c63591aeb1fbe4add759 (diff)
downloadTango-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.cs23
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);
+ }
}