Ejemplo n.º 1
0
        public async Task <ApiResponse <int> > CreateCurrency(CreateCurrencyFrontCommand currency)
        {
            try
            {
                await AddBearerToken();

                var mappedCurrency = _mapper.Map <CreateCurrencyCommand>(currency);
                var response       = await _client.CreateCurrencyAsync(ApiVersion.apiVersion, mappedCurrency);

                return(new ApiResponse <int>()
                {
                    Data = response.Data, Success = true
                });
            }
            catch (ApiException ex)
            {
                return(ConvertApiExceptions <int>(ex));
            }
        }
Ejemplo n.º 2
0
 protected override void OnInitialized()
 {
     Currency = new CreateCurrencyFrontCommand();
 }