【发布时间】:2010-08-29 00:54:12
【问题描述】:
假设我正在编写一个用户必须预约的应用程序(在我的例子中,用户与员工配对,并且该员工将在一天中的特定时间为该用户工作)。我将如何确保 2 个用户最终不会使用 NHibernate 或实体框架预订同一个约会?我会打开交易并执行以下操作:
BeginTransaction();
if(!AppointmentBooked(userId, employeeId, time)) // read
BookAppointment(userId, employeeId, time); // write
CommitTransaction();
【问题讨论】:
标签: c# nhibernate entity-framework orm concurrency