Exemplo n.º 1
0
        public async Task <Customer> AddCustomerAsync(Customer customer)
        {
            _dbContext.Set <Customer>().Add(customer);
            await _dbContext.SaveChangesAsync();

            return(customer);
        }
        public async Task <Service> AddServiceAsync(Service service)
        {
            _dbContext.Set <Service>().Add(service);
            await _dbContext.SaveChangesAsync();

            return(service);
        }
Exemplo n.º 3
0
        public async Task <Room> AddRoomAsync(Room room)
        {
            _dbContext.Set <Room>().Add(room);
            await _dbContext.SaveChangesAsync();

            return(room);
        }
Exemplo n.º 4
0
        public async Task <Roomtype> AddRoomTypeAsync(Roomtype roomType)
        {
            _dbContext.Set <Roomtype>().Add(roomType);
            await _dbContext.SaveChangesAsync();

            return(roomType);
        }
 public virtual async Task <T> GetByIdAsync(int id)
 {
     return(await _dbContext.Set <T>().FindAsync(id));
 }