public ResponseModel Insert(LocalizedResource localizedResource) { return _localizedResourceRepository.Insert(localizedResource); }
/// <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; }
public ResponseModel Delete(LocalizedResource localizedResource) { return _localizedResourceRepository.Delete(localizedResource); }
public ResponseModel Update(LocalizedResource localizedResource) { return _localizedResourceRepository.Update(localizedResource); }