예제 #1
0
 public Response <List <ProducerViewModel> > GetAllProducers()
 {
     try
     {
         var data = _producerRepository.GetAllProducers();
         if (data != null && data.Any())
         {
             return(new Response <List <ProducerViewModel> >(true, "Success", data));
         }
         return(new Response <List <ProducerViewModel> >(false, "Fail", null));
     }
     catch (Exception e)
     {
         _logger.Error($"GetAllProducers Failed: {e.Message}\n {e.StackTrace}");
         return(new Response <List <ProducerViewModel> >(false, e.Message, null));
     }
 }