{"id":5834,"date":"2025-04-28T07:26:37","date_gmt":"2025-04-28T14:26:37","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/odata\/?p=5834"},"modified":"2025-10-08T01:16:25","modified_gmt":"2025-10-08T08:16:25","slug":"asp-net-core-odata-web-api-template-preview-release","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/asp-net-core-odata-web-api-template-preview-release\/","title":{"rendered":"ASP.NET Core OData Web API Template Preview Release"},"content":{"rendered":"<p>We are excited to announce the public preview release of the <strong>ASP.NET Core OData Web API Template Pack<\/strong>. This template helps you create an ASP.NET Core Web API project with OData support, providing a streamlined setup for .NET 8.0 and above. The following preview release is now available on NuGet:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.OData.WebApiTemplate\/1.0.0-preview.2\"><span class=\"pl-c1\">Microsoft.OData.WebApiTemplate<\/span>\n<\/a><\/li>\n<\/ul>\n<h3>Key Features<\/h3>\n<div>\n<ul>\n<li><strong>Support for .NET 8.0 and above<\/strong>: Easily create projects targeting the latest .NET versions.<\/li>\n<li><strong>OData Query Options<\/strong>: Enable query options like <code>$filter<\/code>, <code>$select<\/code>, <code>$expand<\/code>, <code>$orderby<\/code>, and <code>$count<\/code>.<\/li>\n<li><strong>OpenAPI (Swagger) Support<\/strong>: Enable OpenAPI support for better API documentation.<\/li>\n<li><strong>Batching Support<\/strong>: Allow OData batching in your project.<\/li>\n<li><strong>Case Insensitive Routing<\/strong>: Enable case insensitive routing for controller\/action property names.<\/li>\n<\/ul>\n<\/div>\n<h2>Installation<\/h2>\n<p>To install the template, use the following command:<\/p>\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new install Microsoft.OData.WebApiTemplate<\/code><\/pre>\n<h2>Usage<\/h2>\n<h3>Using dotnet CLI<\/h3>\n<p>Create a new project using the template:<\/p>\n<ul>\n<li><span data-teams=\"true\">Create template with default settings<\/span>\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi -n MyODataService1<\/code><\/pre>\n<\/li>\n<li><span data-teams=\"true\">Specify .NET framework<\/span>\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi -n MyODataService2 -f net8.0\r\n<\/code><\/pre>\n<\/li>\n<li><span data-teams=\"true\">Enable OData batching<\/span>\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi -n MyODataService3 --enable-batching true\r\n<\/code><\/pre>\n<\/li>\n<li><span data-teams=\"true\">Enable query options<\/span>\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi -n MyODataService4 --query-option filter select expand<\/code><\/pre>\n<\/li>\n<li>Enable OpenAPI\/Swagger\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi -n MyODataService5 --enable-openapi true<\/code><\/pre>\n<\/li>\n<li>To view template options:\n<pre class=\"prettyprint language-js\"><code class=\"language-js\">dotnet new odata-webapi --help<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>Using Visual Studio IDE<\/h3>\n<ol>\n<li><strong>Open the &#8220;Create a new project&#8221; dialog:\n<\/strong><strong>\n<\/strong>When you first open Visual Studio, the start window appears, and from there, you can select <strong>Create a new project<\/strong>.\n<img decoding=\"async\" class=\"\" src=\"https:\/\/devblogs.microsoft.com\/odata\/wp-content\/uploads\/sites\/23\/2025\/04\/20250427-visual-studio-start-window.png\" alt=\"Visual Studio start window\" \/><\/li>\n<li><strong>Select a template type<\/strong>\n<ul>\n<li>On the <code>Create a new project<\/code> dialog, search for <code>OData<\/code> or <code>OData Web API<\/code>.<\/li>\n<li>Select <code>ASP.NET Core OData Web API Template<\/code> and then select <strong>Next<\/strong>.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"\" src=\"https:\/\/devblogs.microsoft.com\/odata\/wp-content\/uploads\/sites\/23\/2025\/04\/20250427-create-new-project-dialog.png\" alt=\"Create a new project\" \/><\/li>\n<li><strong>Configure your new project:\n<\/strong>The <strong>Configure your new project<\/strong> dialog has options to name your project (and solution), select a disk location, and more.<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/odata\/wp-content\/uploads\/sites\/23\/2025\/04\/20250427-configure-new-project.png\" alt=\"Configure your new project\" \/><\/li>\n<li><strong>Additional information dialog:\n<\/strong>This includes options to select when creating an <code>AspNetCore OData Web API project<\/code>. It includes:<\/p>\n<ul>\n<li><strong>Framework<\/strong>: The target framework to use for the project.<\/li>\n<li><strong>ODataQueryOptions<\/strong>: OData query options. You can multi-select all of them or specific options like <code>filter<\/code>, <code>select<\/code>, <code>expand<\/code>, <code>orderby<\/code>, and <code>count<\/code>. Default is all of them selected.<\/li>\n<li><strong>EnableNoDollarQueryOptions<\/strong>: Whether or not to prefix OData system query options with &#8216;$&#8217;. Default is true.<\/li>\n<li><strong>EnableDefaultODataBatch<\/strong>: Allowing OData batching.\nDefault is false.<\/li>\n<li><strong>EnableOpenAPI<\/strong>: Enables OpenAPI (Swagger) support.\nDefault is true.<\/li>\n<\/ul>\n<p>Select <strong>Create<\/strong> to create the new project.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/odata\/wp-content\/uploads\/sites\/23\/2025\/04\/20250427-additional-information-for-odata.png\" alt=\"OData WebAPI Settings or configuration\" \/><\/li>\n<li><strong>Build and run the project:\n<\/strong>Build and run the application. Navigate to the <code>{Your-project-name}.http<\/code> to test some endpoints provided there.<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/odata\/wp-content\/uploads\/sites\/23\/2025\/04\/20250427-your-project-name_http.png\" alt=\"{Your-project-name}.http\" \/><\/li>\n<\/ol>\n<h2>Feedback<\/h2>\n<p>We value your feedback! Please report any issues or suggestions on our\n<a href=\"https:\/\/github.com\/OData\/ODataDotNetTemplate\">GitHub repository<\/a>.<\/p>\n<p>Thank you for trying out the ASP.NET OData Core Web API Template! Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the public preview release of the ASP.NET Core OData Web API Template Pack. This template helps you create an ASP.NET Core Web API project with OData support, providing a streamlined setup for .NET 8.0 and above. The following preview release is now available on NuGet: Microsoft.OData.WebApiTemplate Key Features Support for [&hellip;]<\/p>\n","protected":false},"author":169392,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1472,117],"tags":[],"class_list":["post-5834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net-core","category-webapi"],"acf":[],"blog_post_summary":"<p>We are excited to announce the public preview release of the ASP.NET Core OData Web API Template Pack. This template helps you create an ASP.NET Core Web API project with OData support, providing a streamlined setup for .NET 8.0 and above. The following preview release is now available on NuGet: Microsoft.OData.WebApiTemplate Key Features Support for [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/5834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/169392"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=5834"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/5834\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=5834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=5834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=5834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}