c# - register unitofwork in StructureMap -
i need use structuremap register interface .
i need register unitofwork in structuremap .
definition of unitowork methods in applicationdbcontext
. how can register unitofwork ?
public static void initioc() { var container = new container(_ => { _.for<iunitofwork>().use<applicationdbcontext>(new applicationdbcontext()); _.for<iuser>().use<efuserservice>(); }); // now, resolve new object instance of ifoo container.getinstance<iuser>(); }
it not work .
the type 'dbcontext' defined in assembly not referenced. must add reference assembly 'entityframework, version=6.0.0.0, culture=neutral, publickeytoken=19f9d7d4cc76b670'.
i think confused register. have register unitofwork registering repositories. can find same problem here. dependency injection in unit of work pattern using repositories
Comments
Post a Comment