sql server - Entity Framework - Update and Delete at same time -


i want update record , delete @ same time in entity framework.

can ? or straight way, first update record , delete ?

my scenario:

i want delete record. before deleting record, want add comment(which column in table), why deleting record.

if think, why add comment while anyway deleting record, here doing.

if change made record, there trigger creates log record in audit table. so, want log comment.

my concern update , deleting using 2 commands create 2 log records.

you cannot update record , simultaneously delete in same operation in sql server, whether use entity framework or not. it's possible update , delete in context of same transaction, still 2 separate sql operations , logging trigger fire both times.

if possible modify logging, write trigger code special logic ensure have 1 log entry, have address @ level rather @ database operation level.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -