Esempio n. 1
0
 public static Film Get(int id)
 {
     if (id <= 0)
     {
         throw new MediaManagerException($"Erreur : {nameof(id)} <= 0", ExceptionReturnType.Error);
     }
     try
     {
         Film result;
         using (var context = new MediaManagerContext())
             using (var repository = new FilmRepository(context))
             {
                 result = repository.Get(id);
             }
         return(result);
     }
     catch (Exception ex)
     {
         throw new MediaManagerException($"Erreur : {ex.Message}", ExceptionReturnType.Error);
     }
 }
Esempio n. 2
0
 public Film Get(int id)
 {
     return(filmDal.Get(id).ToLocal());
 }