Example #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);
        }
Example #3
0
        public async Task <Room> AddRoomAsync(Room room)
        {
            _dbContext.Set <Room>().Add(room);
            await _dbContext.SaveChangesAsync();

            return(room);
        }
Example #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));
 }