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")); } }
public bool Exists(string name) { return(_repo.Exists(name)); }