public void UpdateCable(Cable n) { var c = GetCableById(n.Id); if (c!=null) { c.description = n.description; c.CableTypesId = n.CableTypesId; _db.SaveChanges(); } }
public Cable AddCable(Cable n) { var c = _db.Cables.Add(n); _db.SaveChanges(); return c; }