public IHttpActionResult PutJanitorService(int id, JanitorService roomService)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != roomService.Id)
            {
                return(BadRequest());
            }

            db.Entry(roomService).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoomServiceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
 public AdminController(
     ILogger <AdminController> logger,
     IHubContext <AppHub, IHubEvent> hub,
     TransferService transferSvc,
     FileUploadOptions fileUploadOptions,
     JanitorService janitor,
     HubCache hubCache,
     IMemoryCache localCache
     ) : base(logger, hub)
 {
     _transferSvc   = transferSvc;
     _uploadOptions = fileUploadOptions;
     _hubCache      = hubCache;
     _janitor       = janitor;
     _localCache    = localCache;
 }
Example #3
0
 public AdminController(
     ILogger <AdminController> logger,
     IIdentityResolver identityResolver,
     ChatService chatService,
     IHubContext <TopologyHub, ITopoEvent> hub,
     TransferService transferSvc,
     FileUploadOptions fileUploadOptions,
     JanitorService janitor,
     HubCache hubCache
     ) : base(logger, identityResolver)
 {
     _chatService   = chatService;
     _transferSvc   = transferSvc;
     _uploadOptions = fileUploadOptions;
     _hub           = hub;
     _hubCache      = hubCache;
     _janitor       = janitor;
 }