コード例 #1
0
 public IActionResult Get()
 {
     try
     {
         var autor = _repository.Get();
         return(new ObjectResult(autor));
     }catch (Exception e)
     {
         return(StatusCode(500, new { erro = "Falha no servidor! Tente novamente mais tarde" }));
     }
 }
コード例 #2
0
        public ActionResult Index()
        {
            var autores = repository.Get();

            return(View(autores));
        }
コード例 #3
0
 public IEnumerable <AutorDto> SearchByName(string text)
 {
     return(Map(_repository.Get(w => w.AutorName.Contains(text))));
 }
コード例 #4
0
 public Autor Get(int id)
 {
     return(_autorRepository.Get(id));
 }
コード例 #5
0
 public IHttpActionResult Get(int?id = null)
 {
     return(Ok(_autorRepository.Get()));
 }