public async Task <IActionResult> OnPost() { if (UpdatedNews != null) { if (UpdatedNews.Body != null) { NewsHandler newsHandler = new NewsHandler(); newsHandler.SaveNews(UpdatedNews); } } if (openHours != null && (openHours.Days != null || openHours.Houres != null)) { OpenHoursHandler openHoursHandler = new OpenHoursHandler(); openHoursHandler.Save(openHours); } await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); return(Redirect("/Index")); }
public void OnGet() { NewsHandler newsHandler = new NewsHandler(); LastNews = newsHandler.GetNews(); }