public async Task<NotificationResultModel> CreateLanguage(LanguageModel input) { try { var model = new NotificationResultModel { Status = 1}; var language = new Language { Name = input.Name, DisplayOrder = input.DisplayOrder, LanguageCulture = input.LanguageCulture, Published = input.Published, UniqueSeoCode = input.UniqueSeoCode }; model.Status = ((int)(await LanguageBll.Insert(language))) > 0? 0 : 1; return await Task.FromResult(model); } catch (Exception ex) { ErrorStore.LogExceptionWithoutContext(ex); return new NotificationResultModel(); } }
public async Task<LanguageModel> GetOneLanguage(GetOneInputModel input) { try { var item = await LanguageBll.GetOneLanguage(input.Id); var model = new LanguageModel { Id = item.Id, Name = item.Name, DisplayOrder = item.DisplayOrder, LanguageCulture = item.LanguageCulture, Published = item.Published, UniqueSeoCode = item.UniqueSeoCode }; return await Task.FromResult(model); } catch (Exception ex) { ErrorStore.LogExceptionWithoutContext(ex); return new LanguageModel(); } }