示例#1
0
 public NewsService(ILogger <NewsService> logger,
                    IDateTimeProvider dateTimeProvider,
                    IGraCache cache,
                    IJobRepository jobRepository,
                    INewsCategoryRepository newsCategoryRepository,
                    INewsPostRepository newsPostRepository,
                    ISiteRepository siteRepository,
                    IUserContextProvider userContextProvider,
                    IUserRepository userRepository,
                    EmailService emailService)
     : base(logger, dateTimeProvider, userContextProvider)
 {
     SetManagementPermission(Permission.ManageNews);
     _cache         = cache ?? throw new ArgumentNullException(nameof(cache));
     _jobRepository = jobRepository
                      ?? throw new ArgumentNullException(nameof(jobRepository));
     _newsCategoryRepository = newsCategoryRepository
                               ?? throw new ArgumentNullException(nameof(newsCategoryRepository));
     _newsPostRepository = newsPostRepository
                           ?? throw new ArgumentNullException(nameof(newsPostRepository));
     _siteRepository = siteRepository
                       ?? throw new ArgumentNullException(nameof(siteRepository));
     _userRepository = userRepository
                       ?? throw new ArgumentNullException(nameof(userRepository));
     _emailService = emailService
                     ?? throw new ArgumentNullException(nameof(emailService));
 }
示例#2
0
 public HomeController(ILogger <HomeController> logger, INewsPostRepository newsRepo,
                       IListingRepository listingRepo, UserManager <AppUser> usrMgr)
 {
     _logger           = logger;
     newsRepository    = newsRepo;
     listingRepository = listingRepo;
     userManager       = usrMgr;
 }