IocConfig

From Logic Wiki
Revision as of 13:46, 12 October 2016 by AliIybar (Talk | contribs) (Created page with "<pre> using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.Identity; using Microsoft.Owin.Security; using MyAccount.Appl...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.Identity;
using Microsoft.Owin.Security;
using MyAccount.Application.Models.Authentication;
using MyAccount.Ioc.Registries;

using MyAccount.Web.Models;
using StructureMap;

namespace MyAccount.Web.App_Start
{
        }
public class IocConfig
{
    public static IContainer Setup()
    {
        var container = new Container(
            x =>
            {
                //x.For<IUserStore<ApplicationUser>>().Use<UserStore<ApplicationUser>>();
                x.For<IAuthenticationManager>().Use(() => HttpContext.Current.GetOwinContext().Authentication);
                x.AddRegistry<ApplicationRegistry>();

                x.Scan(y =>
                {
                    y.WithDefaultConventions();
                    y.LookForRegistries();

                });
            }
    );

        return container;
    }

}