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); } }
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); } }
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); }
public void InsertNode(NodeDetails node) { throw new NotImplementedException(); }
public void DeclareNodeDead(NodeDetails node) { throw new NotImplementedException(); }