exsvelte/Web/Controllers/HomeController.cs
2020-11-10 21:44:20 +11:00

28 lines
616 B
C#

using Microsoft.AspNetCore.Mvc;
namespace Web.Controllers
{
[Route("Home")]
public class HomeController : Controller
{
[Route("Hello")]
public JsonResult Hello(Hello request)
{
return new JsonResult(new HelloResponse() {Result = $"hello, {request?.Name ?? "System.NullReferenceException"}"});
}
public IActionResult Index()
{
return View();
}
}
public class Hello
{
public string Name { get; set; }
}
public class HelloResponse
{
public string Result { get; set; }
}
}