示例#1
0
 public async Task <GetTagByIdResponse> Handle(GetTagByIdRequest request)
 {
     return(new GetTagByIdResponse()
     {
         Tag = TagApiModel.FromTag(await _dataContext.Tags.FindAsync(request.Id))
     });
 }
            public async Task <GetTagsResponse> Handle(GetTagsRequest request)
            {
                var tags = await _dataContext.Tags.ToListAsync();

                return(new GetTagsResponse()
                {
                    Tags = tags.Select(x => TagApiModel.FromTag(x)).ToList()
                });
            }