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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -