public static string CheckConcurrency <T>(T entity) where T : class, ICacheable { var lup = Dao.Single <T, DateTime>(entity.Id, x => x.LastUpdateTime); if (entity.LastUpdateTime.CompareTo(lup) == 0) { return(""); } using (var w = WorkspaceFactory.Create()) { var loaded = w.Single <T>(x => x.Id == entity.Id); var cr = ValidatorRegistry.GetConcurrencyErrorMessage(entity, loaded); if (cr.SuggestedOperation == SuggestedOperation.Refresh) { RemoveFromEntityCache(entity); } return(cr.ErrorMessage); } }