private async Task CreateDefaultTranslation(ProductCategoryChangedEvent e) { var defaultLocaleResult = await _localesService.GetDefaultLocale(); if (defaultLocaleResult.IsFailed) { // cannot create localized values if default locale does not exist throw new DefaultLocaleDoesNotExistException("Default locale must exist before trying to create currency translations"); } var value = new LocalizedValue() { Locale = defaultLocaleResult.Value.Id, Key = e.NewValue.LocalizationToken, Value = e.OriginalCategoryName ?? e.NewValue.Id, }; await _localizedValuesService.AddAsync(value, e.Username, e.CorrelationId); }
private async Task CreateDefaultTranslation(CurrencyChangedEvent e) { var defaultLocaleResult = await _localesService.GetDefaultLocale(); if (defaultLocaleResult.IsFailed) { // cannot create localized values if default locale does not exist throw new DefaultLocaleDoesNotExistException("Default locale must exist before trying to create currency translations"); } var value = new LocalizedValue() { Locale = defaultLocaleResult.Value.Id, Key = GetKey(e.NewValue.Id), Value = e.NewValue.InterestRateMdsCode, }; await _localizedValuesService.AddAsync(value, e.Username, e.CorrelationId); }