public async Task <ActionResult <ActorDTO> > GetActorById(int id, [FromQuery] string[] including = null)
        {
            try
            {
                var result = await _repository.Get <Actor>(id, including);

                return(Ok(ExpandSingleItem(result)));
            }
            catch (Exception e)
            {
                var result = new { Status = StatusCodes.Status500InternalServerError, Data = $"Failed to retrieve the actor with id {id}. Exception thrown when attempting to retrieve data from the database: {e.Message}" };
                return(this.StatusCode(StatusCodes.Status500InternalServerError, result));
            }
        }
Beispiel #2
0
 public IActionResult Get()
 {
     return(Ok(_repository.Get()));
 }
Beispiel #3
0
 public Actor Get(int entityId)
 {
     return(_actorRepository.Get(entityId));
 }
 public IEnumerable <Actor> Get()
 {
     return(_repository.Get().Select(c => c.ToClient()));
 }
 public async Task <IEnumerable <Actor> > GetAll(
     [Service] IActorRepository repository)
 {
     return(await repository.Get(0, int.MaxValue));
 }