I'm thinking about starting a new project using EF 4 and going through some articles, I found an article about EF with repository pattern and unit of work (http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx)
Looking at that article, it uses the ObjectContext as the UnitOfWork and it passes it to the Repository.
My question is what if I have 2 ObjectContext which mean I will have 2 unit of work, but I actually wants all the operation perform on those 2 context to be one single unit of work, is this scenario possible? I don't want to call save on each context, I'd like it to be transactional .... without using transactionscope ...
For example, I have a context that manages Operation Log and another context that manages Orders. Lets say In my business layer, I have a method called AddOrder(). AddOrder() will use the order context to create a new order, but it will also use the operation log context to create a new operation log entry. Since those are 2 context, I'll have to call save on both context to commit .... maybe the only option is to have only one single context ....
EDIT: I meant 2 context of different types for example: OperationalLogContext and OrderContext.