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