Stored Procedure without transaction in Entity Framework

后端 未结 1 505
轮回少年
轮回少年 2020-12-06 19:09

I\'m calling a stored procedure in Entity Framework 6 that can create Databases and tables if necessary. It is throwing the error;

Message \"CREAT

相关标签:
1条回答
  • 2020-12-06 19:46

    I found a way:

    var snapshotQueueIDParameter = new SqlParameter("SnapshotQueueID", entityId);
    return _db.Database.ExecuteSqlCommand(TransactionalBehavior.DoNotEnsureTransaction,
            "EXEC spCreateSnapshotFromQueue @SnapshotQueueID", snapshotQueueIDParameter);
    
    0 讨论(0)
提交回复
热议问题