public async Task CreateOrUpdateLanguage(CreateOrUpdateLanguageInput input) { if (input.Language.Id.HasValue) { await UpdateLanguageAsync(input); } else { await CreateLanguageAsync(input); } }
protected virtual async Task UpdateLanguageAsync(CreateOrUpdateLanguageInput input) { Debug.Assert(input.Language.Id != null, "input.Language.Id != null"); var culture = GetCultureInfoByChecking(input.Language.Name); await CheckLanguageIfAlreadyExists(culture.Name, input.Language.Id.Value); var language = await _languageRepository.GetAsync(input.Language.Id.Value); language.Name = culture.Name; language.DisplayName = culture.DisplayName; language.Icon = input.Language.Icon; await _applicationLanguageManager.UpdateAsync(AbpSession.TenantId, language); }
protected virtual async Task CreateLanguageAsync(CreateOrUpdateLanguageInput input) { var culture = GetCultureInfoByChecking(input.Language.Name); await CheckLanguageIfAlreadyExists(culture.Name); await _applicationLanguageManager.AddAsync( new ApplicationLanguage( AbpSession.TenantId, culture.Name, culture.DisplayName, input.Language.Icon ) ); }