{"id":13102,"date":"2023-03-08T08:00:41","date_gmt":"2023-03-08T16:00:41","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=13102"},"modified":"2023-03-07T07:31:43","modified_gmt":"2023-03-07T15:31:43","slug":"microsoft-graph-net-sdk-v5-is-now-generally-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-net-sdk-v5-is-now-generally-available\/","title":{"rendered":"Microsoft Graph .NET SDK v5 is now generally available\u00a0"},"content":{"rendered":"<p><span data-contrast=\"none\">The <b>Microsoft Graph .NET SDK v5, now generally available (GA), <\/b>allows you to take advantage of a fluent API and models that support retry handling, secure redirects, batching requests, large file management, and many more capabilities. F<\/span><span data-contrast=\"none\">ocus on what really matters, your business.\u00a0<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Along with all the features and improvements highlighted in the <\/span><a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/write-simpler-code-with-the-new-microsoft-graph-net-sdk-v5\/\"><span data-contrast=\"none\">v5 release candidate announcement<\/span><\/a><span data-contrast=\"none\">, such OData cast support and backing store, this GA release delivers a small change described below.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">OData cast now provides shorter names<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\">Because OData cast allows downcasting the result to the right specialized type, v5 users now have access to all properties in the response, rather than pulling those out from the <\/span><b><span data-contrast=\"none\">AdditionalData<\/span><\/b><span data-contrast=\"none\">. To not require users to use the fully qualified name as a code path to cast, the OData cast was simplified to provide the shortest name possible when still avoiding collisions.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>https:\/\/gist.github.com\/maisarissi\/f9a6825cd51abc5128049af1b4a805fb<\/p>\n<p><span class=\"TextRun SCXW48374003 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun CommentStart CommentHighlightPipeClicked CommentHighlightClicked SCXW48374003 BCX8\">For those using v5 preview versions, <\/span><span class=\"NormalTextRun CommentHighlightClicked SCXW48374003 BCX8\">the OData cast was shortened from <\/span><span class=\"NormalTextRun SpellingErrorV2Themed CommentHighlightClicked SCXW48374003 BCX8\">MicrosoftGraph<\/span><span class=\"NormalTextRun CommentHighlightClicked SCXW48374003 BCX8\">&lt;Entity&gt; to Graph&lt;Entity&gt;. In the <\/span><span class=\"NormalTextRun CommentHighlightClicked SCXW48374003 BCX8\">example above, it changed from <\/span><\/span><span class=\"TextRun SCXW48374003 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SpellingErrorV2Themed CommentHighlightClicked SCXW48374003 BCX8\">MicrosoftGraphUser<\/span><\/span><span class=\"TextRun SCXW48374003 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun CommentHighlightClicked SCXW48374003 BCX8\"> to <\/span><\/span><span class=\"TextRun SCXW48374003 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SpellingErrorV2Themed CommentHighlightClicked SCXW48374003 BCX8\">GraphUser<\/span><\/span><span class=\"TextRun SCXW48374003 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun CommentHighlightClicked SCXW48374003 BCX8\">.<\/span><\/span><span class=\"EOP CommentHighlightPipeClicked SCXW48374003 BCX8\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Methods doesn&#8217;t require full namespaces<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"auto\">As a similar approach to the OData cast, users now don&#8217;t need to specify the MicrosoftGraph namespace as part of the method. This change simplifies the fluentAPI by keeping only the method name as part of the method chaining.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>https:\/\/gist.github.com\/maisarissi\/68f10c40921fc872b9deed775d2580c2<\/p>\n<p><span data-contrast=\"none\">For those using previews versions of v5, the method was shortened from MicrosoftGraph&lt;Method&gt; to only &lt;Method&gt;, given the example above, it changed from <\/span><b><span data-contrast=\"none\">MicrosoftGraphSendMail<\/span><\/b><span data-contrast=\"none\"> to <\/span><b><span data-contrast=\"none\">SendMail<\/span><\/b><span data-contrast=\"none\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Next steps<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\">Check it out <\/span><a href=\"https:\/\/aka.ms\/graph\/sdk\/dotnet\/upgrade-to-v5\"><span data-contrast=\"none\">this upgrade guide<\/span><\/a><span data-contrast=\"none\"> to access a detailed document that outlines any breaking changes, fixes and will guide you through the migration that an SDK user might run while upgrading to v5 as well as provide examples for implementing the new features, helping you quickly take advantage of all the new capabilities.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Add the new SDK to your project by running the following command in the Package Manager Console:<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"none\">Install-Package Microsoft.Graph<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Try out the new version today!<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\">Try out the <\/span><a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Graph\/5.0.0\"><span data-contrast=\"none\">new version<\/span><\/a><span data-contrast=\"none\"> and let us know what you think\u202f<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-sdk-dotnet\/issues\/new\"><span data-contrast=\"none\">on GitHub<\/span><\/a><span data-contrast=\"none\">! For questions about the Microsoft Graph API, go to <\/span><a href=\"https:\/\/docs.microsoft.com\/en-us\/answers\/topics\/microsoft-graph-sdk.html\"><span data-contrast=\"none\">Microsoft Q&amp;A<\/span><\/a><span data-contrast=\"none\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Learn more about Microsoft Graph SDKs<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\">The SDK includes a set of tools, libraries, and documentation that make it easy to get started building applications that take advantage of the rich data and insights available through Microsoft Graph API.<\/span><\/p>\n<p><span data-contrast=\"none\">Start saving time and removing complexity in your code today. <\/span><span data-contrast=\"auto\">Sign up for the<\/span> <a href=\"https:\/\/developer.microsoft.com\/en-us\/microsoft-365\/dev-program\"><span data-contrast=\"none\">Microsoft 365 Developer Program<\/span><\/a> <span data-contrast=\"auto\">to get a free Microsoft 365 developer subscription and start using <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/tutorials\/dotnet?view=graph-rest-1.0&amp;tabs=aad\"><span data-contrast=\"none\">.NET to connect to Microsoft Graph<\/span><\/a><span data-contrast=\"auto\">. We also recommend that you join our <\/span><a href=\"https:\/\/aka.ms\/m365\/community\"><span data-contrast=\"none\">Microsoft 365 Platform community<\/span><\/a> <span data-contrast=\"auto\">calls and events and get involved with other developers who use Microsoft Graph and build solutions for Microsoft 365.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Here are some resources we have pulled together to help you get started.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">Explore <\/span><a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/sdks\/sdks-overview\"><span data-contrast=\"none\">our public documentation<\/span><\/a><span data-contrast=\"auto\">, where you can find how to install the SDK, authenticate, discover which API a cmdlet is calling and more.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Use the <\/span><a href=\"https:\/\/aka.ms\/ge\"><span data-contrast=\"none\">Microsoft Graph Explorer<\/span><\/a><span data-contrast=\"auto\">, a tool that lets you make requests and see responses against the Microsoft Graph, and which displays corresponding snippets to requests you make.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">Visit the <\/span><a href=\"https:\/\/developer.microsoft.com\/graph\"><span data-contrast=\"none\">Microsoft Graph Dev Center<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/li>\n<\/ul>\n<h2 aria-level=\"1\"><span data-contrast=\"none\">Thank you!<\/span><span data-ccp-props=\"{&quot;134245418&quot;:true,&quot;134245529&quot;:true,&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559738&quot;:240,&quot;335559739&quot;:0,&quot;335559740&quot;:259}\">\u00a0<\/span><\/h2>\n<p><span data-contrast=\"none\">We\u2019d like to thank all the members of the community who have helped us make this release better by reporting issues in <\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-sdk-dotnet\"><span data-contrast=\"none\">GitHub<\/span><\/a><span data-contrast=\"none\">! Keep them coming!<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335551550&quot;:6,&quot;335551620&quot;:6,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Take advantage of a fluent API and models that support retry handling, secure redirects, batching requests, large file management and more with the Microsoft Graph .NET SDK v5, now generally available.<\/p>\n","protected":false},"author":76658,"featured_media":13110,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[151],"class_list":["post-13102","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-microsoft-graph-net-sdk"],"acf":[],"blog_post_summary":"<p>Take advantage of a fluent API and models that support retry handling, secure redirects, batching requests, large file management and more with the Microsoft Graph .NET SDK v5, now generally available.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/13102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/76658"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=13102"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/13102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/13110"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=13102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=13102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=13102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}