private async Task DeleteAllTranslations(CurrencyChangedEvent e)
        {
            var key    = GetKey(e.OldValue.Id);
            var values = await _localizedValuesService.GetAllByKey(key);

            foreach (var value in values)
            {
                await _localizedValuesService.DeleteAsync(value.Locale, value.Key, e.Username, e.CorrelationId);
            }
        }
Beispiel #2
0
        private async Task DeleteAllTranslations(ProductCategoryChangedEvent e)
        {
            var key    = e.OldValue.LocalizationToken;
            var values = await _localizedValuesService.GetAllByKey(key);

            foreach (var value in values)
            {
                await _localizedValuesService.DeleteAsync(value.Locale, value.Key, e.Username, e.CorrelationId);
            }
        }
Beispiel #3
0
        public async Task <ErrorCodeResponse <LocalizedValuesErrorCodesContract> > Delete(string locale, string key,
                                                                                          [FromBody] DeleteLocalizedValueRequest request)
        {
            var response      = new ErrorCodeResponse <LocalizedValuesErrorCodesContract>();
            var correlationId = this.TryGetCorrelationId();

            var result = await _localizedValuesService.DeleteAsync(locale, key, request.UserName, correlationId);

            if (result.IsFailed)
            {
                response.ErrorCode = _mapper.Map <LocalizedValuesErrorCodesContract>(result.Error.GetValueOrDefault());
            }

            return(response);
        }