(Edited) My asp.net core version is 2.0
I am new to programming. I am currently trying to call Microsoft Graph to list all of the application objects in my Azure AD tenant and save them JSON files.
I am using the Microsoft Graph SDK. When I make the call, the results comes back as a collection of Microsoft.Graph.Application objects but I can't convert them to JSON.
I've tried to convert the result using .ToString(), but each object just becomes "Microsoft.Graph.Application".
Is there a good way to do this?
IConfidentialClientApplication daemonClient = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithClientSecret(clientSecret)
.WithTenantId(tenantId)
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(daemonClient);
GraphServiceClient graphServiceClient = new GraphServiceClient(authProvider);
GetApplicationList(graphServiceClient, log).GetAwaiter().GetResult();
var applicationList = await graphServiceClient.Applications.Request().GetAsync();
Newtonsoft.Jsonfrom NuGet. It makes things very easy to turn json to objects and objects to json.System.Text.Jsonset of classes which provides out-of-the-box JSON (de)serialization without a dependency onNewtonsoft.Json. It's a bit simpler, and doesn't support some more sophisticated scenarios, but it's also supposed to be faster for most cases. Microsoft's documentation for this is quite good.