public void AddNewComponent(Component comp)
 {
     dbContext.Components.Add(comp);
     dbContext.SaveChanges();
 }
 public void UpdateComponent(int compId, Component component)
 {
     var itemToUpdate = dbContext.Components.SingleOrDefault(x => x.ComponentId == compId);
     if (itemToUpdate != null)
     {
         itemToUpdate = component;
         dbContext.SaveChanges();
     }
 }