Accroding to your description,as far as I think,you could update them one-by-one in a Foreach.Then you could call SaveChanges().
More details,you could refer to below codes:
WallPaperCategory std = (from x in Context.WallPaperCategries
where .... // add where condition here
select x).ToList();
foreach (WallPaperCategory x in std )
{
x.is_default = false;
}
Context.SaveChanges();
ASP.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
Contributor
4050 Points
1568 Posts
Re: update data on button click using linq in asp.net Entity Framework
Aug 14, 2020 03:01 AM|yij sun|LINK
Hi guestadmin@nirvriti.com,
Accroding to your description,as far as I think,you could update them one-by-one in a Foreach.Then you could call SaveChanges().
More details,you could refer to below codes:
More details,you could refer to below article:
https://stackoverflow.com/questions/20832684/update-records-using-linq
Best regards,
Yijing Sun