public async Task <GetStoryByIdResponse> Handle(GetStoryByIdRequest request)
 {
     return(new GetStoryByIdResponse()
     {
         Story = StoryApiModel.FromStory(await _context.Stories.FindAsync(request.Id))
     });
 }
Exemple #2
0
            public async Task <GetStoriesResponse> Handle(GetStoriesRequest request)
            {
                var stories = await _context.Stories.ToListAsync();

                return(new GetStoriesResponse()
                {
                    Stories = stories.Select(x => StoryApiModel.FromStory(x)).ToList()
                });
            }
Exemple #3
0
 public async Task <Response> Handle(Request request)
 {
     return(new Response()
     {
         Story = StoryApiModel.FromStory(await _context.Stories
                                         .Include(x => x.Tenant)
                                         .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                                         .SingleAsync(x => x.Id == request.Id))
     });
 }
Exemple #4
0
            public async Task <Response> Handle(Request request)
            {
                var stories = await _context.Stories
                              .Include(x => x.Tenant)
                              .Where(x => x.Tenant.UniqueId == request.TenantUniqueId)
                              .ToListAsync();

                return(new Response()
                {
                    Stories = stories.Select(x => StoryApiModel.FromStory(x)).ToList()
                });
            }