Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
 }