草庐IT

TranscationScope

全部标签

c# - Entity Framework 6 异步操作和 TranscationScope

我在stackoverflow上搜索,没有找到类似的问题,如果已经有请指出我。我试图通过同步和异步操作实现一个通用的可重用存储库,但由于我对EntityFramework和工作单元知之甚少,我正在努力寻找实现它的正确方法。我在SaveAndCommit操作上添加了一些变体,但不知道使用事务和异步执行此操作的最佳方法是什么。----Edit----AspermyunderstandingtransactionsshouldbeusedwhenmorethanoneoperationsisperformedbutforunderstandingpurposesIuseditforoneop