If you look at this MSDN documentation there is a sample with the following code:
// Define a change interceptor for the Products entity set.
[ChangeInterceptor("Products")]
public void OnChangeProducts(Product product, UpdateOperations operations)
{
if (operations == UpdateOperations.Add ||
operations == UpdateOperations.Change)
{
// Reject changes to discontinued products.
if (product.Discontinued) //<-- IS THIS BASED ON UNVERIFIED CLIENT DATA???
{
throw new DataServiceException(400,
"A discontinued product cannot be modified");
}
}
else if (operations == UpdateOperations.Delete)
{
// Block the delete and instead set the Discontinued flag.
throw new DataServiceException(400,
"Products cannot be deleted; instead set the Discontinued flag to 'true'");
}
}
Look at the comment in all CAPS. My question is: "Is that line dependent on client supplied data... and if so, what can we do to have a secure validation"?