Does Linq to SQL call of submitchanges() with no changes to submit - do anything? -
Does Linq to SQL call of submitchanges() with no changes to submit - do anything? -
i have several updates database tables may or may not happen. rather calling submitchanges() multiple times rather phone call once.
potentially there no alter submit database.
my question whether linq in scenario? or whether smart plenty know no update required , nil happens - hence no overhead.
thanks advice.
if (settempresult) { tr = new tempresult(); db.tempresults.insertonsubmit(tr); tr.userid = tl.us.userid; tr.result = serializer.serialize(tl.responselist); tr.resulttime = datetime.now; } if (string.isnullorempty(tl.actioncategory)) { action ac = new action(); ac.userid = tl.us.userid; ac.operation = "str"; db.actions.insertonsubmit(ac); } db.submitchanges();
depending on backend, should able observe whether changes have been made. instance entity framework uses called object states in dbcontext , attached entities.
you can read here: http://msdn.microsoft.com/en-us/library/bb386982(v=vs.110).aspx
linq-to-sql
Comments
Post a Comment