updated to use the new DataverseClient and targeting .net standard 2.0
@seanmcne , please review and merge and publish the nuget package.
@seanmcne , any thoughts?
@mohsinonxrm were you able to verify all the tests work? I also have a dataverse compatible build of this but i haven't pushed it to github yet (originally I was waiting for some changes to land). One other thing I had done was copied the previous v9 version into a 9.2 folder, committed that, then did my updates so I can get history - leaves me somewhat regretting the version specific folder structure :)
@seanmcne , I can't remember about the test results. I'll run them again and update here. I actually did the same, I created a new folder for v9.2, kept the structure. BTW, this is just a straight replace of CrmServiceClient with CDS/Dataverse ServiceClient, and now it targets .net standard 2.0, so users can use in .net framework or dotnet core projects.
Anyway, I'll review the test and update here with the results.
I'm curious how you're finding faults to work - I've been running some fault exception tests which aren't working quite right (due to the usage of OrganizationServiceFaults before). I'm still digging in on this - I suspect it will have to be shifted over to DataverseOperationException i'll do some picking away at what I've got here and see if I can get it wired up well enough to function.
As far as I can tell, exceptions are working fine. I am getting exceptions back from the Execute method in the handler, I will test more however, what are you running into?
@seanmcne , can you push your new branch as well? I'd like to review your test cases
Give this test a try - this should produce a DataverseOperationException which was not handled when I ran the test on my end - I adjusted everything to handle both faultExceptions and DataverseOperationException's which appears to work.
public void ParallelProxy_CreateWithExceptionsTest()
{
int targetCount = 3;
int errorCount = 0;
var createTargets = new List<Entity>(targetCount);
for (var i = 0; i < targetCount; i++)
{
var target = new Entity("account");
target["error_name"] = String.Format("Test #{0}", i);
createTargets.Add(target);
}
try
{
var createResponses = this.OrganizationManager.ParallelProxy.Create(createTargets, (e, ex) => { errorCount++; });
Assert.AreEqual(0, createResponses.Count(), "Create responses should be 0.");
Assert.AreEqual(createTargets.Count, errorCount, "Error count should equal create target count.");
}
catch (AggregateException ex)
{
Assert.Fail("Error handling approach should not throw an exception: {0}", ex.InnerExceptions.Count > 0 ? ex.InnerExceptions[0].Message : ex.Message);
}
}
@seanmcne , you're right. It fails the test. DataverseOperationException is of course new.
How would you like to proceed with this PR? do you want to merge this and add your changes/fixes?
OR
you can paste your catch block here and I can add it to the PR.
@seanmcne - any update on releasing the version compatible with the .net core sdk.
Thanks.