コード例 #1
0
        public async Task <IActionResult> GetActor(int id)
        {
            try
            {
                var actorExists = await _actorRepo.Exists(id);

                if (!actorExists)
                {
                    return(NotFound());
                }
                var actor = await _actorRepo.FindById(id);

                var actorDTO = _mapper.Map <ActorDTO>(actor);
                return(Ok(actorDTO));
            }
            catch (Exception E)
            {
                return(StatusCode(500, "Something went wrong. please contact your admin"));
            }
        }
コード例 #2
0
 public bool Exists(string name)
 {
     return(_repo.Exists(name));
 }