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));
            }
        }
Esempio n. 2
0
 public IActionResult Get()
 {
     return(Ok(_repository.Get()));
 }
Esempio n. 3
0
 public Actor Get(int entityId)
 {
     return(_actorRepository.Get(entityId));
 }
 public IEnumerable <Actor> Get()
 {
     return(_repository.Get().Select(c => c.ToClient()));
 }
Esempio n. 5
0
 public async Task <IEnumerable <Actor> > GetAll(
     [Service] IActorRepository repository)
 {
     return(await repository.Get(0, int.MaxValue));
 }