Skip to content

Conversation

@mohsinonxrm
Copy link

No description provided.

mohsinonxrm and others added 5 commits November 4, 2021 17:52
Pfe with Dataverse Client v9.2 targetting .netstandard 2.0
this should be no longer needed though, as Dataverse Client has been ported over to use MSAL instead.
added file check for IdentityModel.
@mohsinonxrm
Copy link
Author

mohsinonxrm commented Nov 6, 2021

@seanmcne , please review and merge and publish the nuget package.

@mohsinonxrm
Copy link
Author

@seanmcne , any thoughts?

@seanmcne
Copy link
Owner

seanmcne commented Jan 26, 2022

@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 :)

@mohsinonxrm
Copy link
Author

@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.

@seanmcne
Copy link
Owner

seanmcne commented Feb 23, 2022

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.

@mohsinonxrm
Copy link
Author

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?

@mohsinonxrm
Copy link
Author

@seanmcne , can you push your new branch as well? I'd like to review your test cases

@seanmcne
Copy link
Owner

seanmcne commented Mar 4, 2022

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);
            }
        }

@mohsinonxrm
Copy link
Author

mohsinonxrm commented Apr 13, 2022

@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.

cloned useWebApi as well, need to set it to false for now to handle exceptions properly
@sabrish
Copy link

sabrish commented Jan 18, 2023

@seanmcne - any update on releasing the version compatible with the .net core sdk.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants