I host a wcf workflow service within my ASP.NET MVC2 application.
I need to be able to load/save data inside my workflow (WF4).
How it can be done? Should I just instantiate my Entity Framework context within my activities and read/write?
Cheers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several ways you can go about getting your data. You can use something like the WF ADO.NET Activity Pack CTP 1 from CodePlex, it works but can’t say I am a fan. You can do something similar using EF, NHibernate ect in a CodeActivity. But in general I always tell people to split the what from the how. The workflow should be concerned with the what part and you should keep the how outside of the workflow itself. That would mean create a real simple activity that works with a workflow extension and put you data access code in the workflow extension. Once you do this your workflow extension is just another data repository and you can use standard coding techniques there.