/// <summary> /// 创建新 <see cref="CachedDataProvider" /> /// </summary> /// <param name="dbContext"> /// <see cref="KeylolDbContext" /> /// </param> /// <param name="redis"> /// <see cref="RedisProvider" /> /// </param> public CachedDataProvider(KeylolDbContext dbContext, RedisProvider redis) { Likes = new LikeOperations(dbContext, redis); Subscriptions = new SubscriptionOperations(dbContext, redis); Points = new PointOperations(dbContext, redis); Users = new UserOperations(dbContext, redis, Subscriptions); ArticleComments = new ArticleCommentOperations(dbContext, redis); ActivityComments = new ActivityCommentOperations(dbContext, redis); Messages = new MessageOperations(dbContext, redis); }
/// <summary> /// 创建 <see cref="UserOperations"/> /// </summary> /// <param name="dbContext"><see cref="KeylolDbContext"/></param> /// <param name="redis"><see cref="RedisProvider"/></param> /// <param name="subscription"><see cref="SubscriptionOperations"/></param> public UserOperations(KeylolDbContext dbContext, RedisProvider redis, SubscriptionOperations subscription) { _subscription = subscription; _redis = redis; _dbContext = dbContext; }