mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
添加DI支持
This commit is contained in:
@@ -3,15 +3,28 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using OpenAuth.App;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class HomeController : BaseController
|
||||
{
|
||||
private LoginApp _loginApp;
|
||||
|
||||
public HomeController()
|
||||
{
|
||||
_loginApp = (LoginApp)DependencyResolver.Current.GetService(typeof(LoginApp));
|
||||
}
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public string LoadUsers()
|
||||
{
|
||||
return JsonConvert.SerializeObject(_loginApp.LoadUsers());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user