Linq to sql + update table

Here's a newb question for you.

I have a multi-level environment, so I donโ€™t have the source datacontext file where the element was created, so I had a problem updating the table correctly. That's what I'm doing:

1.) Get the object from the DAL layer 2.) make changes 3.) call the update at the DAL level and transfer the changed object 4.) at the DAL level, where im is trying to update:

var a = (p => p.ID == 3);
a = myPassedInEntity
myContext.Update();

if I check 'a' before calling the update, it has the values โ€‹โ€‹myPassedInEntity, but saving just saves the old data.

Why is there no UpdateOnSubmit (), as is InsertOnSubmit ()?

+3
source share
1 answer

- . . - Linq, DataContext, .

+2

Source: https://habr.com/ru/post/1711001/


All Articles