예제 #1
0
        private async Task CreateEntity(Bet bet)
        {
            var entity = new BetEntity
            {
                BetId        = bet.State.BetId,
                CreationDate = bet.State.CreationDate,
                Description  = bet.State.Description,
                EndDate      = bet.State.EndDate,
                Coins        = bet.State.Coins,
                CreatorId    = bet.State.Creator.Id.Value
            };
            await _dbContext.Set <BetEntity>().AddAsync(entity);

            _domainEventsAccessor.AddDomainEvents(bet.DomainEvents);
        }
예제 #2
0
        public async Task SaveAsync(Member member)
        {
            await _dbContext.AddAsync(new MemberEntity
            {
                MemberId   = member.Id.Value,
                MemberName = member.Name,
                Wallet     = member.Wallet
            });

            _domainEventsAccessor.AddDomainEvents(member.DomainEvents);
        }
예제 #3
0
        public async Task SaveAsync(User user)
        {
            var userEntity = new UserEntity
            {
                UserId       = user.UserId,
                Username     = user.Username,
                Email        = user.Email.ToString(),
                Password     = user.Password,
                RegisterDate = user.RegisterDate
            };
            await _dbContext.AddAsync(userEntity).ConfigureAwait(false);

            _domainEventsAccessor.AddDomainEvents(user.DomainEvents);
        }
 public Task SaveAsync(Bet bet)
 {
     _domainEventsListener.AddDomainEvents(bet.DomainEvents);
     _bet = bet.State;
     return(Task.CompletedTask);
 }
예제 #5
0
 public Task SaveAsync(User user)
 {
     _users.Add(user);
     _domainEventsAccessor?.AddDomainEvents(user.DomainEvents);
     return(Task.CompletedTask);
 }
예제 #6
0
 public Task SaveAsync(IReadOnlyCollection <Member> members)
 {
     _domainEventsListener?.AddDomainEvents(members.SelectMany(x => x.DomainEvents).ToList());
     return(Task.CompletedTask);
 }