Telerik Forums
UI for ASP.NET MVC Forum
1 answer
266 views

Hi all,

I started working with Blazor few weeks ago and recently got introduced to Telerik UI for Blazor so I started making a CRUD to learn.

After coding the update function I tested the app and got this error when I tried to update a register:

The instance of entity type 'Familia' cannot be tracked because another instance with the same key value for {'CodiFamilia'} is already being tracked.

To solve that I added "AsNoTracking" to the Entity Framework Core query located in "ReadList", it worked the first time but the app crashed after the second update. Afterwards I implemented an alternative solution which consists on finding the object by its ID and updating every parameter one by one which worked since it's not using the same object.

I'm wondering if there is any way to implement a functional update which resembles the first solution because the second one is pretty bad if there are many parameters to update azarshagle.

Thanks in advance.

Jack
Top achievements
Rank 1
 updated question on 16 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?