private EquipmentSoftware CreateModel(EquipmentSoftwareBindingModel model, EquipmentSoftware eqSoft) { eqSoft.SoftwareId = model.SoftwareId; eqSoft.EquipmentId = model.EquipmentId; return(eqSoft); }
public void Delete(EquipmentSoftwareBindingModel model) { using (var context = new ComputingEquipmentDatabase()) { EquipmentSoftware eqSoft = context.EquipmentSoftware.FirstOrDefault(rec => rec.Id == model.Id); if (eqSoft != null) { context.EquipmentSoftware.Remove(eqSoft); context.SaveChanges(); } else { throw new Exception("Данная пара \"Техника - ПО\" не найдена"); } } }