Microsoft.Xrm.Sdk.Async
Microsoft.Xrm.Sdk.Async copied to clipboard
Failed Request Returns default Instead of Throwing
Unknown exceptions cause the process to return default(T) instead of throwing. For example, the following code will generate a FaultException and return a null response.
var query = new QueryExpression("account");
query.Criteria.AddCondition("primarycontactid", ConditionOperator.Equal, new EntityReference("account", Guid.NewGuid()));
var response = await service.RetrieveMultipleAsync(query);
// response is null.
This could be especially painful to troubleshoot for requests that callers might not normally check the response for like a Create or WinOpportunityRequest.