-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start trying to remove graph api sdk dependency #1003
base: dev
Are you sure you want to change the base?
Conversation
var subscriptionModel = MapGraphEntityToModel(subscription); | ||
return subscriptionModel; | ||
}).GetAwaiter().GetResult(); | ||
var response = JToken.Parse(responseAsString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting string to Model seems like it could be an extension method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tagging @KoenZomers as he wrote a lot of the original code
var subscriptionModel = MapGraphEntityToModel(subscription); | ||
return subscriptionModel; | ||
}).GetAwaiter().GetResult(); | ||
var response = JToken.Parse(responseAsString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quails4Eva : would recommend using System.Text.Json over Newtonsoft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've done this. I copied the newtonsoft code from elsewhere in the project, but I think this should be equivalent for system.text.json . It needed the package version updating for .net standard. I've changed it to use the same version for each target framework as I don't think system.text.json is tied to framework versions as some other packages are
Next time I have some free time to look at this I'll try and replace the other usages in SubscriptionsUtility |
I started adding some async http bits to maintain where async was already being used, but then I realised that the async usage was all wrapped in Task.Run so probably not really helping anything. I can undo that if you'd rather it be put back. |
GivenName = usr.GivenName != null ? usr.GivenName : string.Empty, | ||
Surname = usr.Surname != null ? usr.Surname : string.Empty, | ||
Email = usr.Mail != null ? usr.Mail : string.Empty, | ||
MobilePhone = usr.MobilePhone != null ? usr.DisplayName : string.Empty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the behaviour change for MobilePhone and Job Title. Is it right that these were returning the Display Name instead?
I've just used the System.Text.Json ability to store overflow properties in a dictionary, they'll be whatever type that uses. It's still a breaking change as the old version could return objects from the Graph Sdk, but not much that can be done about that when we're removing Graph Sdk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSGraph package reference is still in here, is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that was an oversight from me. I've removed it now.
I also removed Microsoft.Graph.Core and it still builds, though I can add that back in if it causes issues.
We were able to identify the issue causing this, I did a wrong reference of this PR my code. Sorry for the false alarm. Cheers |
So, when will this fix / update be available as PnP Nuget package? Checked today, Graph client is still included. |
Reduce dependency on Microsoft.Graph NuGet package
Based on discussion in #660
#660 (comment)