添加DI支持

This commit is contained in:
yubaolee
2015-09-23 00:10:11 +08:00
parent 2a5cdd453f
commit a284f975c3
10 changed files with 383 additions and 363 deletions

View File

@@ -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());
}
}
}