Translate Unity config statement into Structure Map statement for dependency injection into Identity Security Model

Hi:

I have an application that uses StructureMap for dependency injection.  I need to upgrade it so that it uses the Identity security model.   As part of this process I need to register IUser - the code to do this using Unity is :
container.RegisterType<IUserStore<ApplicationUser>, UserStore<ApplicationUser>>( new InjectionConstructor(typeof(ApplicationDbContext)));

Open in new window


What I need to do is translate this statement so that I am registering it using Structure Map.  

I'm afraid my knowledge of both the Identity framework and dependency injection is not very strong.   Any help in translating the above statement for Unity into Structure Map would be greatly appreciated.

RBS
RBSAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kblauCommented:
IContainer container = IoC.Initialize();
            aUserStore<User> function = container.GetInstance<aUserStore<User>>();
            function.GH();
////
public static class IoC
    {
        public static IContainer Initialize()
        {
            ObjectFactory.Initialize(x =>
            {
                x.For<IUserStore<User>>().Use<aUserStore<User>>();
            });
            return ObjectFactory.Container;
        }
    }

    public class aUserStore<T> : IUserStore<T> where T : class, Microsoft.AspNet.Identity.IUser<string>
    {

        public void GH(){

        }

        public System.Threading.Tasks.Task CreateAsync(T user)
        {
            throw new NotImplementedException();
        }

        public System.Threading.Tasks.Task DeleteAsync(T user)
        {
            throw new NotImplementedException();
        }

        public System.Threading.Tasks.Task<T> FindByIdAsync(string userId)
        {
            throw new NotImplementedException();
        }

        public System.Threading.Tasks.Task<T> FindByNameAsync(string userName)
        {
            throw new NotImplementedException();
        }

        public System.Threading.Tasks.Task UpdateAsync(T user)
        {
            throw new NotImplementedException();
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }
    }

    public class User : IUser<string>
    {

        public string Id
        {
            get { throw new NotImplementedException(); }
        }

        public string UserName
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }
    }
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RBSAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.