Exemplo n.º 1
0
        public async Task AddRangeAsync(IEnumerable <User> users)
        {
            _sql.Users.AddRange(users);
            await _sql.SaveChangesAsync();

            await _mongoRepository.AddRangeAsync(users);
        }
Exemplo n.º 2
0
        public async Task <Result> Handle(CreateUserActivityCommand request, CancellationToken cancellationToken)
        {
            var userActivities = _mapper.Map <List <UserActivity> >(request.UserActivities);

            userActivities.ForEach(x =>
            {
                x.UserId   = Guid.Parse(_currentUserService.UserId);
                x.FullName = _currentUserService.FullName;
            });

            await _userActivityRepository.AddRangeAsync(userActivities);

            return(Result.SuccessFul());
        }
Exemplo n.º 3
0
        public async Task <IEnumerable <TEntity> > AddRangeAsync(IEnumerable <TEntity> documents)
        {
            await _mongoRepository.AddRangeAsync(documents);

            return(documents);
        }