Пример #1
0
 public void Save()
 {
     try
     {
         _myDbContext.SaveChanges();
     }
     catch (Exception e)
     {
         _logger.LogError(e.Message);
     }
 }
Пример #2
0
        public async Task <IEnumerable <Rate> > GetRate()
        {
            try
            {
                ListRate = await _serviceRate.GetAsync();

                if (ListRate != null)
                {
                    await _mydbContextDB.AddRangeAsync(ListRate);

                    _mydbContextDB.SaveChanges();
                }

                return(ListRate);
            }
            catch (Exception e)
            {
                _logger.LogError(e.Message);
                return(null);
            }
        }