-
Notifications
You must be signed in to change notification settings - Fork 95
/
HomeController.cs
42 lines (34 loc) · 1.13 KB
/
HomeController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Web.Mvc;
using CustomAuthenticationMvc.App_Start;
using ServiceStack;
namespace CustomAuthenticationMvc.Controllers
{
public class HomeController : BaseController
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your app description page.";
return View();
}
public ActionResult RunHelloService()
{
using (var helloService = HostContext.ResolveService<HelloService>(base.HttpContext))
{
var response = (HelloResponse)helloService.Any(new HelloRequest { Name = User.Identity.Name });
ViewBag.Response = response.Result;
ViewBag.Counter = ServiceStackSession.Get<int>(HelloService.HelloServiceCounterKey);
return View("Index");
}
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
}