Esempio n. 1
0
        public async Task <IdentityResult> CreateAsync(User user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            if (user is null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            await _context.Users.AddAsync(user, cancellationToken);

            var affectedRows = await _context.SaveChangesAsync(cancellationToken);

            return(affectedRows > 0
                ? IdentityResult.Success
                : IdentityResult.Failed(new IdentityError {
                Description = $"Could not create user {user.UserName}."
            }));
        }
Esempio n. 2
0
        public async Task AddAsync(IEnumerable <ReviewersScienceWork> reviewersScienceWorks)
        {
            await _context.ReviewersScienceWorks.AddRangeAsync(reviewersScienceWorks);

            await _context.SaveChangesAsync();
        }
Esempio n. 3
0
 public async Task AddAnswerToReviewAsync(Review review)
 {
     _context.Reviews.Update(review);
     await _context.SaveChangesAsync();
 }
Esempio n. 4
0
        public async Task AddAsync(ScientificWork scienceWork)
        {
            await _context.ScientificWorks.AddAsync(scienceWork);

            await _context.SaveChangesAsync();
        }
Esempio n. 5
0
        public async Task AddAsync(ScientificWorkFile scientificWorkFile)
        {
            await _context.ScientificWorkFiles.AddAsync(scientificWorkFile);

            await _context.SaveChangesAsync();
        }