/// <summary> /// deletes a hotel from the table /// </summary> /// <param name="ID">ID of the hotel to be deleted</param> /// <returns></returns> public async Task DeleteHotel(int ID) { HotelsDTO hoteldto = await GetHotel(ID); Hotels hotel = await _context.Hotels.FirstOrDefaultAsync(x => x.ID == hoteldto.ID); _context.Entry(hotel).State = Microsoft.EntityFrameworkCore.EntityState.Deleted; await _context.SaveChangesAsync(); }
public void Update(HotelsDTO item) { wrapperHotels.UpdateItem(mapper.Map <HotelsDTO, Hotels>(item)); }
public void AddItem(HotelsDTO item) { wrapperHotels.AddItem(mapper.Map <HotelsDTO, Hotels>(item)); }