Пример #1
0
        public async Task <IActionResult> GetActorsAsync()
        {
            try
            {
                var actorsObj = await _actorRepo.FindAll();

                var actorsDTO = _mapper.Map <IList <ActorDTO> >(actorsObj);
                return(Ok(actorsDTO));
            }
            catch (Exception E)
            {
                return(StatusCode(500, "Something went wrong. please contact your admin"));
            }
        }
Пример #2
0
        //
        // GET: /Actor/

        public ActionResult Index()
        {
            var actors = _repository.FindAll();

            return(View(actors.ToList()));
        }