Пример #1
0
        private async Task <Unit> AddToDatabaseAsync(FollowEntity follow, CancellationToken cancellationToken)
        {
            await _followRepo.AddAsync(follow, cancellationToken);

            if (await _followRepo.SaveAllAsync())
            {
                return(await Task.FromResult(Unit.Value));
            }

            throw new DatabaseException("Error occured while updating database.");
        }