Exemplo n.º 1
0
        public async Task <ActionResult <Actor> > Get(int id)
        {
            if (await actorLogic.FindByIdAsync(id) == null)
            {
                return(NotFound());
            }

            return(Ok(await actorLogic.FindByIdAsync(id)));
        }
Exemplo n.º 2
0
        public async Task FindByIdAsyncTest(int actorId, bool expectedFound)
        {
            var actor = await actorLogic.FindByIdAsync(actorId);

            if (expectedFound)
            {
                Assert.NotNull(actor);
                Assert.Equal(actorId, actor.ActorId);
            }
            else
            {
                Assert.Null(actor);
            }
        }