Optimizing the LINQSQL Class

The LINQSQL class provides a wrapper around the Users table implementation in both the source and destination databases. Using the <InsertRecord> methods, we can migrate records into our destination database or create records in our source table.

However, look at our current implementations: We’re creating a new instance of the User class and then mapping the values from the source to the destination through the instance itself.

Recall that when we created Users.dbml you implemented the SaveUser stored procedure. The reason for that will now be clear. I want to use the stored procedure call on our LINQ To SQL implementation instead of creating a new instance of the user record, mapping the values, and then calling Commitchanges. ...

Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.