コード例 #1
0
        public async Task <Guid> Persist(ReleasePlayerInstructionCreatedEvent e, CancellationToken ct)
        {
            var entity = Map(e);
            await _transferInstructions.InsertOneAsync(entity, null, ct);

            return(entity.Id);
        }
コード例 #2
0
 public async Task <Guid> FindMatchingTransferInstructionId(
     ReleasePlayerInstructionCreatedEvent e, CancellationToken ct)
 {
     return(await Query()
            .Find(i =>
                  i.EngagingClubId == e.EngagingClubId &&
                  i.ReleasingClubId == e.ReleasingClubId &&
                  i.PlayerId == e.PlayerId && i.Type == TransferInstructionType.Engaging
                  ).Project(x => x.Id)
            .FirstOrDefaultAsync(ct));
 }
コード例 #3
0
 private TransferInstruction Map(ReleasePlayerInstructionCreatedEvent e)
 {
     return(new()
     {
         EngagingClubId = e.EngagingClubId,
         ReleasingClubId = e.ReleasingClubId,
         PlayerId = e.PlayerId,
         PlayersContract = e.PlayersContract,
         Type = TransferInstructionType.Releasing,
         CreatedOn = DateTime.Now
     });
 }