entity framework - How to implement a Quartz.NET job in ASP.NET MVC with UnitOfWorkPattern on EF Code first -


i have asp.net mvc 3.0 application, ef code first data layer. have implemented unit of work pattern, i’m binding context of unit of work on httpcontext.current.items[somekey] collection. unit of work created , committed in onactionexecuting/executed events on controller. i’m instantiating repositories using windsor castle.

now need use quartz.net run job periodically in app, job need use few repositories. problem is, in schedulerjob implementation, there no httpcontext available (indeed). how can instantiate repository (which takes unitofworkfactory constructor parameter) quartz.net job in case? how can substitute missing httpcontext? need implement unitofworkfactory, i’m not sure can bind context , how register different factory quartz.net thread. can please show me way or pattern? thank you.

the unit of work implementation belongs business logic layer , should not depend on specific presentation layer such mvc.

i made custom unitofworkscope i've used in couple of projects: http://coding.abel.nu/2012/10/make-the-dbcontext-ambient-with-unitofworkscope/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -