public static void UpdateVersion(this INakedObjectAdapter nakedObjectAdapter, ISession session, INakedObjectManager manager) { var versionObject = nakedObjectAdapter?.GetVersion(manager); if (versionObject != null) { nakedObjectAdapter.OptimisticLock = new ConcurrencyCheckVersion(session.UserName, DateTime.Now, versionObject); } }
public static void UpdateVersion(this INakedObjectAdapter nakedObjectAdapter, ISession session, INakedObjectManager manager) { object versionObject = nakedObjectAdapter == null ? null : nakedObjectAdapter.GetVersion(manager); if (versionObject != null) { nakedObjectAdapter.OptimisticLock = new ConcurrencyCheckVersion(session.UserName, DateTime.Now, versionObject); Log.DebugFormat("GetObject: Updating Version {0} on {1}", nakedObjectAdapter.Version, nakedObjectAdapter); } }
private INakedObjectAdapter CreateAdapterForViewModel(object viewModel, IObjectSpec spec) { var oid = new ViewModelOid(metamodel, spec); INakedObjectAdapter adapter = NewAdapterForKnownObject(viewModel, oid); object versionObject = adapter.GetVersion(this); if (versionObject != null) { adapter.OptimisticLock = new ConcurrencyCheckVersion(session.UserName, DateTime.Now, versionObject); } identityMap.AddAdapter(adapter); return(adapter); }