Esempio n. 1
0
        public IHttpActionResult PostUserHotelPermissions([FromBody]List<UserHotelPermission> permissions)
        {

            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            UserHotelPermissionRepository permissionRepo = new UserHotelPermissionRepository(new MyRoomDbContext());

            permissionRepo.InsertPermissions(permissions);

            return Ok("Permission Saved");

        }
Esempio n. 2
0
        public IHttpActionResult GetUserHotelPermissions(string userId)
        {
            UserHotelPermissionRepository permissionRepository = new UserHotelPermissionRepository(new MyRoomDbContext());
            return Ok(permissionRepository.GetById(userId));

        }