public async Task <GetProfileByIdResponse> Handle(GetProfileByIdRequest request) { return(new GetProfileByIdResponse() { Profile = ProfileApiModel.FromProfile(await _context.Profiles.SingleAsync(x => x.Id == request.Id && x.TenantId == request.TenantId)) }); }
public async Task <GetMyProfileResponse> Handle(GetMyProfileRequest request) { var profile = await _context.Profiles.Include(x => x.WeightSnapShots) .FirstAsync(); return(new GetMyProfileResponse() { Profile = ProfileApiModel.FromProfile(profile) }); }
public async Task <GetProfilesResponse> Handle(GetProfilesRequest request) { var profiles = await _context.Profiles .Where(x => x.TenantId == request.TenantId) .ToListAsync(); return(new GetProfilesResponse() { Profiles = profiles.Select(x => ProfileApiModel.FromProfile(x)).ToList() }); }