Ejemplo n.º 1
0
 public Infraccion NuevaInfraccion(string identificador, string descripción, int puntos)
 {
     try
     {
         //Si existe la infraccion
         if (Infracciones.Exists(X => X.Identificador == identificador))
         {
             return(null);
         }
         Infraccion i = new Infraccion()
         {
             Identificador = identificador, Descripcion = descripción, PuntosDescontar = puntos
         };
         Infracciones.Add(i);
         return(i);
     }
     catch (Exception e)
     {
         throw e;
     }
 }