コード例 #1
0
 public ResponseModel Insert(LocalizedResource localizedResource)
 {
     return _localizedResourceRepository.Insert(localizedResource);
 }
コード例 #2
0
 /// <summary>
 /// Update new value to database
 /// </summary>
 /// <param name="textKey"></param>
 /// <param name="defaultValue"></param>
 /// <param name="parameters"> </param>
 private string UpdateDictionaryToDb(string textKey, string defaultValue, params object[] parameters)
 {
     var existedResourceIds = Fetch(l => l.TextKey.Equals(textKey)).Select(l => l.LanguageId).ToList();
     var languages = _languageRepository.Fetch(l => !existedResourceIds.Contains(l.Id)).Select(l => l.Id).ToList();
     foreach (var language in languages)
     {
         var localizeResource = new LocalizedResource
         {
             TextKey = textKey,
             DefaultValue = defaultValue,
             TranslatedValue = defaultValue,
             LanguageId = language
         };
         Insert(localizeResource);
     }
     RefreshDictionary();
     if (parameters != null && parameters.Any())
     {
         return string.Format(defaultValue, parameters);
     }
     return defaultValue;
 }
コード例 #3
0
 public ResponseModel Delete(LocalizedResource localizedResource)
 {
     return _localizedResourceRepository.Delete(localizedResource);
 }
コード例 #4
0
 public ResponseModel Update(LocalizedResource localizedResource)
 {
     return _localizedResourceRepository.Update(localizedResource);
 }