private void ValidateServiceCall(long leaseId, long leaseRowVersion) { if (!_leaseService.IsRowVersionEqual(leaseId, leaseRowVersion)) { throw new DbUpdateConcurrencyException("Lease version mismatch."); } }
/// <summary> /// For a deposit service call to be valid, the user must have the lease edit claim and the lease being edited must be up to date. /// </summary> /// <param name="leaseId"></param> /// <param name="leaseRowVersion"></param> private void ValidateServiceCall(long leaseId, long leaseRowVersion) { if (!_leaseService.IsRowVersionEqual(leaseId, leaseRowVersion)) { throw new DbUpdateConcurrencyException("You are working with an older version of this lease, please refresh the application and retry."); } }
/// <summary> /// For a term service call to be valid, the user must have the lease edit claim and the lease being edited must be up to date. /// </summary> /// <param name="leaseId"></param> /// <param name="leaseRowVersion"></param> private void ValidateTermServiceCall(long leaseId, long leaseRowVersion) { _user.ThrowIfNotAuthorized(Permissions.LeaseEdit); if (!_leaseService.IsRowVersionEqual(leaseId, leaseRowVersion)) { throw new DbUpdateConcurrencyException("You are working with an older version of this lease, please refresh the application and retry."); } }