You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
Yes I understand the concept of using more than one DB tables (entities) and tracking all of them with a single source. That's why I came up with my second code block. Isn't it the same? If it is the same, if I can reach the same goal without using UOW why should I use it? In the second code block I also use more than one entities and I can save changes with the shared DBContext. So I think it will produce the same result with UOW. So there are two questions. 1- Am I incorrect, Doesn't the second code block yield the same result with UOW. 2- If it is the same what is the extra benefit of UOW.Mansur Ali Koroglu– Mansur Ali Koroglu2020-03-19 06:43:19 +00:00Commented Mar 19, 2020 at 6:43
-
Can you explain why one needs an additional unit-of-work pattern when entity Framework context already implements the very behaviors you describe?nvoigt– nvoigt2020-03-19 06:44:43 +00:00Commented Mar 19, 2020 at 6:44
-
@Mansur: in which class do you want to place your "second code block"?Doc Brown– Doc Brown2020-03-19 07:02:22 +00:00Commented Mar 19, 2020 at 7:02
-
1@nvoigt: ok, I added a few words. To what you wrote about "people" here: the idea should be that one starts to implement a certain use case, and when the transactional handling of the objects involved becomes obviously too complex, then it is time to refactor the complexity into a separate layer like the UoW. The UoW is not for people who work like braindead zombies and try to throw patterns at a system "just in case" - one has to see the problem in code first, and then solve it, not the other way round.Doc Brown– Doc Brown2020-03-19 08:16:54 +00:00Commented Mar 19, 2020 at 8:16
-
2@DocBrown I absolutely agree with that.nvoigt– nvoigt2020-03-19 08:20:04 +00:00Commented Mar 19, 2020 at 8:20
|
Show 4 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-cs