예제 #1
0
 public async void InsertNode(NodeDetails node)
 {
     try
     {
         using (var context = new SqlDataModel(_connectionString))
         {
             context.NodeDetails.Add(node);
             await context.SaveChangesAsync();
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }
예제 #2
0
 public async void DeclareNodeDead(NodeDetails node)
 {
     try
     {
         using (var context = new SqlDataModel(_connectionString))
         {
             node.IsAlive           = false;
             node.DeadDeclairedDate = DateTime.UtcNow.ToShortTimeString();
             context.NodeDetails.Add(node);
             await context.SaveChangesAsync();
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex);
     }
 }
예제 #3
0
        public NodeDetails GetNode(string nodeId)
        {
            NodeDetails node = null;

            try
            {
                using (var context = new SqlDataModel(_connectionString))
                {
                    node = context.NodeDetails.FirstOrDefault(n => n.IsAlive);
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex);
            }
            return(node);
        }
예제 #4
0
 public void InsertNode(NodeDetails node)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public void DeclareNodeDead(NodeDetails node)
 {
     throw new NotImplementedException();
 }