New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is MvcTransactionFilter related to SchoolContext ? #31
Comments
Do you have a better option? I don't really have your situation. On Monday, October 24, 2016, akarzazi notifications@github.com wrote:
|
The name "MvcTransactionFilter" is misleading ( and somewhat a lie :) ) Actually, I came here looking for the "supposed" better approach ^^. Did you use this approach in real apps ? Therefore those apps do have a single context ? |
Ok......in general I don't try to implement a single approach that works for every situation. I rely on my teams to understand their specific situation and adapt an approach as needed. And yes, my apps have a single DbContext. Single DB, single context. If my apps are talking to multiple DBs, I have a different problem. If you need an ambient transaction, you can also do a System.Transactions transaction. But not all my apps need it. So I'm not interested in creating the One Transaction Filter To Rule Them All. I have an approach, a filter that manages transactions, and then adapt as necessary. |
Indeed, the preferred solution would be a business ambient transaction that is assigned automatically to injected Dbcontexts and that could be injected as a dependency for a use in something else than EF. If the positioning of a beginTransaction is quite simple, the commitTransaction timing is more complicated. |
OK, lemme know what you come up with! |
MvcTransactionFilter works only for SchoolContext.
Is there a way to make MvcTransactionFilter work for multiple datacontexts ?
By the way the multiple contexts may want to share the same transaction scope.
The text was updated successfully, but these errors were encountered: