Ejemplo n.º 1
0
        private async Task LogCurrencyConversion(CurrencyViewModel model, double excahngeRate, string convertedAmount)
        {
            var request = new CurrencyLoggingModel
            {
                Amount           = model.Amount,
                SourceCurrencyId = model.SourceCurrencyId,
                TargetCurrencyId = model.TargetCurrencyId,
                DateLogged       = DateTime.UtcNow,
                Rate             = excahngeRate,
                ConvertedAmount  = convertedAmount
            };

            await _currencyLoggingService.AddCurrencyLog(request);
        }
Ejemplo n.º 2
0
        public async Task <int> AddCurrencyLog(CurrencyLoggingModel model)
        {
            var entity = new CurrencyLoggingEntity
            {
                SourceCurrencyId = model.SourceCurrencyId,
                TargetCurrencyId = model.TargetCurrencyId,
                Amount           = model.Amount,
                Rate             = model.Rate,
                DateLogged       = model.DateLogged,
                ConvertedAmount  = model.ConvertedAmount
            };

            _unitOfWork.Context.Set <CurrencyLoggingEntity>().Add(entity);

            return(await _unitOfWork.CommitAsync());
        }
Ejemplo n.º 3
0
 public async Task <int> AddCurrencyLog(CurrencyLoggingModel model)
 {
     return(await _currencyLoggingRepository.AddCurrencyLog(model));
 }