private void AgregarComision(Commission comision) { if (ExisteComision(comision)) throw new ArgumentException("Comision ya existe"); db.Commissions.Add(comision); }
public bool ExisteComision(Commission comision) { if (comision == null) return false; return (db.Commissions.SingleOrDefault(c => c.ID == comision.ID || c.Name == comision.Name) != null); }