/// <summary> /// /// </summary> /// <param name="key"></param> /// <param name="cultureInfo"></param> /// <returns></returns> public string Get(string key, CultureInfo cultureInfo) { if (Synonyms == null) { return(key); } cultureInfo = cultureInfo ?? CultureService.GetCulture(); var synonymInfo = Synonyms.ToList().FirstOrDefault(f => f.Key == key); if (synonymInfo == null) { return(key); } if (Equals(CultureHelper.UzLanguage, cultureInfo)) { return(synonymInfo.Uz); } if (Equals(CultureHelper.RuLanguage, cultureInfo)) { return(synonymInfo.Ru); } if (Equals(CultureHelper.EnLanguage, cultureInfo)) { return(synonymInfo.En); } return(key); }
public virtual void Invoke(Func <string, string> func) { if (null == func) { throw new ArgumentNullException("func"); } CanonicalForm = func.Invoke(CanonicalForm); var synonyms = Synonyms.ToList(); Synonyms.Clear(); foreach (var synonym in synonyms.OrderBy(x => x)) { Synonyms.Add(func.Invoke(synonym)); } }