Пример #1
0
        public async Task <ServiceEntity> Add(ServiceEntity entity)
        {
            await _coworkingDBContext.Services.AddAsync(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #2
0
        public async Task <AdminEntity> Add(AdminEntity entity)
        {
            // await _coworkingDBContext.Admins.AddAsync(entity);
            _coworkingDBContext.Admins.Add(entity);
            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #3
0
        public async Task <UserEntity> Add(UserEntity entity)
        {
            await _coworkingDBContext.Users.AddAsync(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #4
0
        public async Task <Offices2RoomsEntity> Add(Offices2RoomsEntity entity)
        {
            await _coworkingDBContext.Offices2Rooms.AddAsync(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #5
0
        public async Task <RoomEntity> Add(RoomEntity entity)
        {
            await _coworkingDBContext.Rooms.AddAsync(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #6
0
        public async Task <BookingEntity> Add(BookingEntity entity)
        {
            await _coworkingDBContext.Bookings.AddAsync(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #7
0
        public async Task <RoomEntity> Update(int idEntity, RoomEntity updateEnt)
        {
            var entity = await Get(idEntity);

            entity.Name = updateEnt.Name;

            _coworkingDBContext.Rooms.Update(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }
Пример #8
0
        public async Task <BookingEntity> Update(int idEntity, BookingEntity updateEnt)
        {
            var entity = await Get(idEntity);

            entity.RentWorkSpace = updateEnt.RentWorkSpace;

            _coworkingDBContext.Bookings.Update(entity);

            await _coworkingDBContext.SaveChangesAsync();

            return(entity);
        }