public async Task CreateAsync(Reserver reserver)
 {
     try
     {
         _context.Reservations.Add(reserver);
         await _context.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception("Error in Insert Reservations " + e.Message);
     }
 }
Beispiel #2
0
        public async Task <T> CreateAsync(T entity)
        {
            try
            {
                dataset.Add(entity);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                throw new Exception("Error in: " + e.Message);
            }

            return(entity);
        }
Beispiel #3
0
 public async Task UpdateAsync(User item, User entity)
 {
     try
     {
         _context.Entry(item).CurrentValues.SetValues(entity);
         await _context.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception("Error in: " + e.Message);
     }
 }