webdav portal Dependency resolver added

This commit is contained in:
vfedosevich 2015-01-10 00:49:29 -08:00
parent 6e6b2abd8a
commit 2244ce5add
16 changed files with 210 additions and 35 deletions

View file

@ -0,0 +1,25 @@
using System.Web.SessionState;
using Ninject;
using Ninject.Activation;
using WebsitePanel.WebDavPortal.Config;
using WebsitePanel.WebDavPortal.Models;
namespace WebsitePanel.WebDavPortal.DependencyInjection.Providers
{
public class AccountInfoProvider : Provider<AccountModel>
{
protected override AccountModel CreateInstance(IContext context)
{
var session = context.Kernel.Get<HttpSessionState>();
AccountModel accountInfo = null;
if (session != null)
{
accountInfo = session[WebDavAppConfigManager.Instance.SessionKeys.AccountInfo] as AccountModel;
}
return accountInfo;
}
}
}