I have a query that returns IQueryable, my query consists of join. the end user needs to be able to update certain fields. Rememeber that the fields don’t come from 1 table but are the result of 2 joins.
Hence how do i use the data that i returned from my query and change it and update back to the database?
Do i need to do a futher 2 select queries which would obviosly return an LINQ2SQL CLASS so i can then just change the values in the class and then update the database?
I am little confused the best way around this problem.
When you want to alter some data, you need to work with the classes that LINQ to SQL generated for you. Only this way, LINQ to SQL knows what was changed (change tracking) and how to update the corresponding database record. In other words, a change on an anonymous object or custom object won’t get noticed. The join however, has nothing to do with it.