public bool IsServerBeingPatched(int id) { ServerPatchState state = (from p in _context.ServerPatchStateContext where p.ServerId == id select p).FirstOrDefault(); if (state == null) { return(false); } return(state.Patching); }
public void SetServerPatchState(Server server) { ServerPatchState state = (from p in _context.ServerPatchStateContext where p.ServerId == server.Id select p).FirstOrDefault(); if (state == null) { state = ServerPatchState.CreateServerPatchState(server.Id, true); _context.AddToServerPatchStateContext(state); } state.Patching = true; _context.SaveChanges(); }
public void AddToServerPatchStateContext(ServerPatchState serverPatchState) { base.AddObject("ServerPatchStateContext", serverPatchState); }
public static ServerPatchState CreateServerPatchState(long serverId, bool patching) { ServerPatchState serverPatchState = new ServerPatchState(); serverPatchState.ServerId = serverId; serverPatchState.Patching = patching; return serverPatchState; }