コード例 #1
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Commitments = await _context.Commitments
                   .Include(x => x.CommitmentFrequencies)
                   .Include("CommitmentFrequencies.Frequency")
                   .Include("CommitmentFrequencies.Frequency.FrequencyType")
                   .Where(x => x.ProfileId == request.ProfileId && x.CommitmentFrequencies.Any(f => f.Frequency.FrequencyType.Name == "per day"))
                   .Select(x => CommitmentApiModel.FromCommitment(x)).ToListAsync()
 };
コード例 #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Commitments = await _context.Commitments
                   .Include(x => x.Behaviour)
                   .Include("Behaviour.BehaviourType")
                   .Include(x => x.CommitmentFrequencies)
                   .Include("CommitmentFrequencies.Frequency")
                   .Include("CommitmentFrequencies.Frequency.FrequencyType")
                   .Select(x => CommitmentApiModel.FromCommitment(x)).ToListAsync()
 };
コード例 #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Commitment = CommitmentApiModel.FromCommitment(await _context.Commitments.FindAsync(request.CommitmentId))
 };
コード例 #4
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Commitments = await _context.Commitments.Select(x => CommitmentApiModel.FromCommitment(x)).ToListAsync()
 };