Click here to Skip to main content
14,695,620 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to know what are the update and insert query in one single function using Data context in Linq..Please help me

1 solution

Please follow the links below,

LINQ to SQL[^]
LINQ to SQL: All common operations (Insert, Update, Delete, Get) in one base class[^][^][^]

For calling a single function, add one extra input parameter "operationMode" Add/Edit.
Checking the operationMode value, you can use the appropriate calling for insert and update.

This will give you fair idea to start on your own.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900