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); }
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); }
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); }
public Task SaveAsync(User user) { _users.Add(user); _domainEventsAccessor?.AddDomainEvents(user.DomainEvents); return(Task.CompletedTask); }
public Task SaveAsync(IReadOnlyCollection <Member> members) { _domainEventsListener?.AddDomainEvents(members.SelectMany(x => x.DomainEvents).ToList()); return(Task.CompletedTask); }