webdav portal Dependency resolver added
This commit is contained in:
parent
6e6b2abd8a
commit
2244ce5add
16 changed files with 210 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue