Brainiac V
Brainiac V
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
Third option would be Blazor Server but I wouldn't consider that here if you need more or less a static site.
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
Then you have two choices, MVC which is more boilerplate or Razor pages which is newer and requires typically fewer files and boilerplate.
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
So what kind of app do you want to create at all?
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
A templating engine.
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
what's the purpose?
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
There is no empty project on this list even
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
You talk about opening a project and show us a list from creating projects
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
I don't know what you want, sorry
73 replies
CC#
Created by Biton6The9Gever on 7/15/2024 in #help
✅ ASP.NET open project
There is literally the empty template in the list?
73 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
Then none of the problems above should happen
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
Then modify your data and just call save without async
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
So to solve your problem, let EF Core track your fetched items properly from fetching the data
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
Also don't use SaveChangesAsync as long as you really don't know what the consequences are
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
So you can also remove this code:
_mainDbContext.WorkItems.Attach(existingWorkItem);
_mainDbContext.Entry(existingWorkItem).State = EntityState.Modified;
_mainDbContext.WorkItems.Attach(existingWorkItem);
_mainDbContext.Entry(existingWorkItem).State = EntityState.Modified;
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
So to solve it, you can fetch the original items in a tracked way and modify them, so EF Core knows about it
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
But the real problem here seems to be, that you first fetch existing items without tracking by EF Core, then you modify them, then you attach them to the context and change the state. The issue is probably that at the moment in your application you already have that item tracked by EF Core and that then causes issues.
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
Because that's what EF Core is complaining about right now
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
So the first thing you need to make sure is through debugging is that you don't have two WorkItem entities with the same WorkItemId
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
So why not reading through examples or tutorials?
44 replies
CC#
Created by Emre on 10/7/2023 in #help
❔ Entity framework, tracking same Id multiple times. Need help
Where did you learn that from?
44 replies