You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

2 years ago
using AspNetCoreMVC.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;
namespace AspNetCoreMVC.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
2 years ago
//string url = Url.Action("Privacy", "Home");
//string url = Url.RouteUrl("test", new { test = 123 });
//return Redirect(url);
return RedirectToAction("Privacy");
//return View();
2 years ago
}
public IActionResult Privacy()
{
2 years ago
//int a = 1;
//int b = 3 / (a - 1);
2 years ago
ViewData["Message"] = "Data from privacy";
2 years ago
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}