public HomeController(IArticleService articleService, IOptions <AboutUsPageInfo> aboutUsPageInfo, IMailService mailService, IToastNotification toastNotification) { _articleService = articleService; _aboutUsPageInfo = aboutUsPageInfo.Value; _mailService = mailService; _toastNotification = toastNotification; }
public HomeController(IPostService postService, IOptionsSnapshot <AboutUsPageInfo> aboutUsPageInfo, IMailService mailService, IToastNotification toastNotification, IWritableOptions <AboutUsPageInfo> aboutUsPageWriter) { _postService = postService; _mailService = mailService; _toastNotification = toastNotification; _aboutUsPageWriter = aboutUsPageWriter; _aboutUsPageInfo = aboutUsPageInfo.Value; }
// IOptions bizler için gerekli section'ı okuyor ve burada istemiş olduğumuz sınıfa bunları dolduruyor, appsettings.json dan veri okumak istenildiğinde bu her yerde kullanılabilir // Snapshottan alcak public HomeController(IArticleService articleService, IOptionsSnapshot <AboutUsPageInfo> aboutUsPageInfo, IMailService mailService, IToastNotification toastNotification, IWritableOptions <AboutUsPageInfo> aboutUsPageInfoWriterOptions) { _articleService = articleService; _mailService = mailService; _aboutUsPageInfo = aboutUsPageInfo.Value; _toastNotification = toastNotification; _aboutUsPageInfoWriter = aboutUsPageInfoWriterOptions; }
public async Task <IActionResult> OnGetAsync() { string Response = await DS.GetAsync("AboutUs/GetAboutUsPageInfo"); Info = Newtonsoft.Json.JsonConvert.DeserializeObject <AboutUsPageInfo>(Response); IMTS.setParams("https://www.allportsopen.com/AboutUs", "article", "About Us", "The All Ports Open Network Crew", "https://media.allportsopen.org/Images/LogoSmWText.png"); return(Page()); }
public OptionsController(IOptionsSnapshot <AboutUsPageInfo> aboutUsPageInfo, IWritableOptions <AboutUsPageInfo> aboutUsPageInfoWriter, IToastNotification toastNotification, IOptionsSnapshot <WebsiteInfo> websiteInfo, IWritableOptions <WebsiteInfo> websiteInfoWriter, IOptionsSnapshot <SmtpSettings> smtpSettings, IWritableOptions <SmtpSettings> smtpSettingsWriter, IOptionsSnapshot <ArticleRightSideBarWidgetOptions> articleRightSideBarWidgetOptions, IWritableOptions <ArticleRightSideBarWidgetOptions> articleRightSideBarWidgetOptionsWriter, ICategoryService categoryService, IMapper mapper) { _aboutUsPageInfoWriter = aboutUsPageInfoWriter; _toastNotification = toastNotification; _aboutUsPageInfo = aboutUsPageInfo.Value; _websiteInfoWriter = websiteInfoWriter; _smtpSettingsWriter = smtpSettingsWriter; _smtpSettings = smtpSettings.Value; _websiteInfo = websiteInfo.Value; _articleRightSideBarWidgetOptions = articleRightSideBarWidgetOptions.Value; _articleRightSideBarWidgetOptionsWriter = articleRightSideBarWidgetOptionsWriter; _categoryService = categoryService; _mapper = mapper; }
public IActionResult About(AboutUsPageInfo aboutUsPageInfo) { if (ModelState.IsValid) { _aboutUsPageInfoWriter.Update(x => { x.Header = aboutUsPageInfo.Header; x.Content = aboutUsPageInfo.Content; x.SeoAuthor = aboutUsPageInfo.SeoAuthor; x.SeoDescription = aboutUsPageInfo.SeoDescription; x.SeoTags = aboutUsPageInfo.SeoTags; }); _toastNotification.AddSuccessToastMessage("Hakkımızda Sayfa İçerikleri başarıyla güncellenmiştir.", new ToastrOptions { Title = "Başarılı İşlem!" }); return(View(aboutUsPageInfo)); } return(View(aboutUsPageInfo)); }