Hello All, I have several entity classes that I use for parsing fixed width text files as well as utilizing Linq to SQL. I use these classes to parse data from said text files, and compare to data in the database.
One of these entities has a lot of properties, and I don't want to waste time setting each individual property on the Linq result object.
Is there a way to tell Linq "Here's my object, use this to update the record"? Here's code I'm working on:
if (partialContent.MonthlyAddChange == "A") { bookContentTable.InsertOnSubmit(partialContent); } else if (partialContent.MonthlyAddChange == "C") { var query = from bookContent in bookContentTable where bookContent.EAN == partialContent.EAN select bookContent; if (query != null) { // Do something with query.First() } } }
Is it better to delete the record and do an InsertOnSubmit() in this case?