private void Persist(IEventStoreAggregateId eventStoreAggregateId, IUserAggregate aggregate, IUserState state) { EventStore.AppendEvents(eventStoreAggregateId, ((IUserStateProperties)state).Version, aggregate.Changes, () => { StateRepository.Save(state); }); if (AggregateEventListener != null) { AggregateEventListener.EventAppended(new AggregateEvent <IUserAggregate, IUserState>(aggregate, state, aggregate.Changes)); } }
public WebMailController(IEmailAccountService emailAccountService, IUserService userService, IEmailMessageService emailMessageService, ISendedEmailMessageService sendedEmailMessageService, IUserAggregate userAggregate) { _emailAccountService = emailAccountService; _userService = userService; _emailMessageService = emailMessageService; _sendedEmailMessageService = sendedEmailMessageService; _userAggregate = userAggregate; }
public UserService( IPasswordService passwordService, IUserRepository userRepository, ILogger <UserService> logger, IUserAggregate userAggregate, ITokenService tokenService, IRefreshTokenRepository refreshTokenRepository, ICurrentUserService currentUserService) { _passwordService = passwordService; _userRepository = userRepository; _logger = logger; _userAggregate = userAggregate; _tokenService = tokenService; _refreshTokenRepository = refreshTokenRepository; _currentUserService = currentUserService; }