protected override async Task <Guid> ProcessActionAsync(TCommand request, CancellationToken cancellationToken) { var entity = CreateEntityFromCommand(request); var result = await _entityWriteOnlyRepository.AddAsync(entity) .ConfigureAwait(false); return(result.Uid); }
protected override async Task <ReadableUser> ProcessActionAsync(MoveUserCommand request, CancellationToken cancellationToken) { var user = await _readOnlyRepository.GetSingleOrDefaultAsync(new UserFilterSpecifications.ByUid(request.UserUid)) .ConfigureAwait(false); var userForInsert = _mapper.Map <WritableUser>(user); await _writeOnlyRepository.AddAsync(userForInsert).ConfigureAwait(false); return(user); }
protected override async Task <Guid> ProcessActionAsync(CreateUserCommand request, CancellationToken cancellationToken) { var user = new User { Email = request.Email, Password = _hashManager.GetHash(request.Password), }; var entity = await _userWirteOnlyRepository.AddAsync(user).ConfigureAwait(false); return(entity.Uid); }