public FavoriteArticleCommandHandler(ICurrentUserContext currentUserContext, ConduitDbContext context, IMapper mapper, IDateTime dateTime) { _currentUserContext = currentUserContext; _context = context; _mapper = mapper; _dateTime = dateTime; }
public AddCommentCommandHandler(ICurrentUserContext currentUserContext, ConduitDbContext context, IMapper mapper, IDateTime dateTime) { _currentUserContext = currentUserContext; _context = context; _mapper = mapper; _dateTime = dateTime; }
public GetArticlesQueryHandler( UserManager <ConduitUser> userManager, ConduitDbContext context, IMapper mapper) { _userManager = userManager; _context = context; _mapper = mapper; }
public GetFeedQueryHandler( ICurrentUserContext currentUserContext, ConduitDbContext context, IMapper mapper) { _currentUserContext = currentUserContext; _context = context; _mapper = mapper; }
public ProfileService( UserManager <IdentityUser> userManager, IUserPersonalizationRepository userPersonalizationRepository, IUserIsFollowingRepository userIsFollowingRepository, ConduitDbContext context) { _userManager = userManager; _userPersonalizationRepository = userPersonalizationRepository; _userIsFollowingRepository = userIsFollowingRepository; _context = context; }
public static async Task AddActivityAndSaveChangesAsync( this ConduitDbContext dbContext, ActivityType activityType, TransactionType transactionType, string transactionId, CancellationToken cancellationToken) { await AddActivityAsync(dbContext, activityType, transactionType, transactionId); await dbContext.SaveChangesAsync(cancellationToken); }
public static async Task <Article> FirstArticleOrDefaultWithRelatedEntities(this ConduitDbContext context, string slug, CancellationToken cancellationToken) { return(await context.Articles .Include(a => a.Author) .ThenInclude(au => au.Followers) .Include(a => a.ArticleTags) .ThenInclude(at => at.Tag) .Include(a => a.Favorites) .ThenInclude(f => f.User) .FirstOrDefaultAsync(a => string.Equals(a.Slug, slug, StringComparison.OrdinalIgnoreCase), cancellationToken)); }
public UnfollowUserCommandHandler( ICurrentUserContext currentUserContext, UserManager <ConduitUser> userManager, ConduitDbContext context, IMapper mapper) { _currentUserContext = currentUserContext; _userManager = userManager; _context = context; _mapper = mapper; }
public ProfilesController( UserManager <IdentityUser> userManager, ConduitDbContext context, ILoggerFactory loggerFactory, IProfileService profileService ) { _userManager = userManager; _context = context; _logger = loggerFactory.CreateLogger <ProfilesController>(); _profileService = profileService; }
private ConduitDbContext CreateContext() { var options = new DbContextOptionsBuilder <ConduitDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var context = new ConduitDbContext(options); context.Database.EnsureCreated(); return(context); }
public CommentService(UserManager <IdentityUser> userManager, IArticleRepository articleRepository, ICommentRepository commentRepository, IProfileService profileService, ConduitDbContext context) { _userManager = userManager; _articleRepository = articleRepository; _commentRepository = commentRepository; _profileService = profileService; _context = context; }
public LoginUserCommandHandler( UserManager <ConduitUser> userManager, ConduitDbContext context, ITokenService tokenService, ILogger <LoginUserCommandHandler> logger, IMapper mapper) { _userManager = userManager; _tokenService = tokenService; _logger = logger; _mapper = mapper; _context = context; }
public FollowUserCommandHandler( ICurrentUserContext currentUserContext, ConduitDbContext context, IMapper mapper, UserManager <ConduitUser> userManager, IDateTime dateTime) { _currentUserContext = currentUserContext; _context = context; _mapper = mapper; _userManager = userManager; _dateTime = dateTime; }
public UpdateUserCommandHandler( ICurrentUserContext currentUserContext, IMapper mapper, UserManager <ConduitUser> userManager, ConduitDbContext context, ITokenService tokenService) { _currentUserContext = currentUserContext; _mapper = mapper; _tokenService = tokenService; _userManager = userManager; _context = context; }
public UpdateArticleCommandHandler( ILogger <UpdateArticleCommandHandler> logger, ConduitDbContext context, ICurrentUserContext currentUserContext, IMapper mapper, IDateTime dateTime) { _logger = logger; _context = context; _currentUserContext = currentUserContext; _mapper = mapper; _dateTime = dateTime; }
public CreateUserCommandHandler( ILogger <CreateUserCommandHandler> logger, UserManager <ConduitUser> userManager, ConduitDbContext context, IMapper mapper, ITokenService tokenService) { _logger = logger; _userManager = userManager; _mapper = mapper; _context = context; _tokenService = tokenService; }
public static ConduitDbContext Create(out ConduitUser user) { var options = new DbContextOptionsBuilder <ConduitDbContext>() .UseInMemoryDatabase("Brewdude.Application.Tests.Db") .Options; var context = new ConduitDbContext(options); context.Database.EnsureCreated(); ConduitDbInitializer.Initialize(context); user = context.Users.FirstOrDefault(); return(context); }
public ArticlesController( ILoggerFactory loggerFactory, UserManager <IdentityUser> userManager, ConduitDbContext context, IProfileService profileService, IArticleService articleService, ICommentService commentService) { _logger = loggerFactory.CreateLogger <ArticlesController>(); _userManager = userManager; _context = context; _profileService = profileService; _articleService = articleService; _commentService = commentService; }
public static async Task AddActivityAsync( this ConduitDbContext dbContext, ActivityType activityType, TransactionType transactionType, string transactionId) { var activityLog = new ActivityLog { ActivityType = activityType.GetDescription(), TransactionId = transactionId, TransactionType = transactionType, CreatedAt = DateTime.UtcNow, UpdatedAt = DateTime.UtcNow }; await dbContext.ActivityLogs.AddAsync(activityLog); }
public UserService( SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager, IConfiguration config, ConduitDbContext context, ILoggerFactory loggerFactory, IUserPersonalizationRepository userPersonalizationRepository ) { _signInManager = signInManager; _userManager = userManager; _config = config; _context = context; _logger = loggerFactory.CreateLogger <UserService>(); _userPersonalizationRepository = userPersonalizationRepository; }
public ArticleService( ConduitDbContext context, IArticleRepository articleRepository, IArticleTagsRepository articleTagsRepository, IFavoriteArticleRepository favoriteArticleRepository, IProfileService profileService, ITagsRepository tagsRepository, UserManager <IdentityUser> userManager, IUserIsFollowingRepository userIsFollowingRepository) { _context = context; _articleRepository = articleRepository; _articleTagsRepository = articleTagsRepository; _favoriteArticleRepository = favoriteArticleRepository; _profileService = profileService; _tagsRepository = tagsRepository; _userManager = userManager; _userIsFollowingRepository = userIsFollowingRepository; }
public RepositoryWrite(ConduitDbContext dbContext) { this.dbContext = dbContext; }
public ArticlesController(UserManager <ApplicationUser> userManager, ConduitDbContext context) { _userManager = userManager; _context = context; }
public FavoriteArticleRepository(ConduitDbContext context) { _favoriteArticle = context.FavoriteArticle; }
public ArticleRepositoryWrite(ConduitDbContext dbContext) : base(dbContext) { }
public ArticleCommentsQueryHandler(ConduitDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public TagsController(ConduitDbContext context) { _context = context; }
public UserIsFollowingRepository(ConduitDbContext context) { _userIsFollowingDAO = context.UserIsFollowing; }
public DeleteArticleCommandHandler(ILogger <DeleteArticleCommandHandler> logger, ConduitDbContext context, ICurrentUserContext currentUserContext) { _logger = logger; _currentUserContext = currentUserContext; _context = context; }
public CommentRepository(ConduitDbContext context) { _comments = context.Comment; }