asp.net mvc - Pass method dependency in MVC controller action Method -


how can pass dependency using unity, mvc controller action method ?

for example, if have post action method dependency of itestrepository type, injected through method injection ? not want testrepository instantiated withing action method.

    public actionresult savedata(itestrepository irepoinstance)     {         var save = irepoinstance.savedata();         return view();     } 


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -