i need to use StructureMap for register interface .
i need to register unitofwork in StructureMap .
Definition of unitowork methods in ApplicationDBContext . now how can i register unitofwork ?
public static void InitIoC()
{
var container = new Container(_ =>
{
_.For<IUnitOfWork>().Use<ApplicationDBContext>(new ApplicationDBContext());
_.For<IUser>().Use<EFUserService>();
});
// Now, resolve a new object instance of IFoo
container.GetInstance<IUser>();
}
it not work .
The type 'DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=19f9d7d4cc76b670'.