public async Task <GetTagByIdResponse> Handle(GetTagByIdRequest request) { return(new GetTagByIdResponse() { Tag = TagApiModel.FromTag(await _context.Tags .Include(x => x.Tenant) .SingleAsync(x => x.Id == request.Id && x.Tenant.UniqueId == request.TenantUniqueId)) }); }
public async Task <GetTagsResponse> Handle(GetTagsRequest request) { var tags = await _context.Tags .Include(x => x.Tenant) .Where(x => x.Tenant.UniqueId == request.TenantUniqueId) .ToListAsync(); return(new GetTagsResponse() { Tags = tags.Select(x => TagApiModel.FromTag(x)).ToList() }); }