Closed mmsharepoint closed 1 year ago
GraphServiceClient
instances, (from different namespaces).I guess with that you could do the following:
using Azure.Identity;
using Microsoft.Graph;
using Microsoft.Graph.Models;
// This is the trick, we rename the namespace
using Beta = Microsoft.Graph.Beta;
// And then you can create 2 clients in the same file
var graphClient = new GraphServiceClient(interactiveCredential, scopes );
var betaClient = new Beta.GraphServiceClient(interactiveCredential, scopes );
As the older 4.x.x version will have models and request builders with conflicting namespaces, The suggestion from @svrooij should work out. There also more similar instructions at the link below.
Just wanted to raise some more "discussions" here and ask a question (and give one answer how I handle myself).
Anyone using v1.0 AND beta endpoint together in the own project? How do you handle? Do you use the new published 5.0.0 Graph .NET SDK package which simplifies it a bit? Do you "mix" older <=4.54.0 beta and v1.0 package?
I'd like to use the 5.0.0 but cannot due to one bug exactly in the beta endpoint I want to use AND because I have a Teams project and there is still a dependency with TeamsFx and 4.54.0 So I decided (also always in the past when there was no 5.x.x) to mix with HttpClient. So (not only!) to fulfill the conditions of hack-together I make all my v1.0 calls with .NET SDK and only one call (beta) I make via REST and the HttpClient
Would love to hear your feedback. Concerns, different approaches and why? Helpful for you?