Skip to content
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

Web api migration #6

Merged
merged 6 commits into from
Apr 8, 2015
Merged

Web api migration #6

merged 6 commits into from
Apr 8, 2015

Conversation

ardalis
Copy link
Contributor

@ardalis ardalis commented Apr 3, 2015

A simple article on migrating a Web API 2 project to ASP.NET 5. Includes new /samples/ folder in aspnet/docs root.

@danroth27
Copy link
Member

For RC we will be renaming the ASP.NET 5 Class Library and ASP.NET 5 Console Application templates to something more generic that fits their purpose. We will need to track updating the screen shots accordingly.

ASP.NET 5 Class Library will be renamed to Class Library (Package).
ASP.NET 5 Console Application will be renamed to either Console Application (Package) or Command Library (Package), it's still being debated.

@danroth27
Copy link
Member

Also, the ASP.NET dialog is getting some cleanup. The template names will just be Empty, Website and Web API.

@@ -0,0 +1,145 @@
Migrating From ASP.NET Web API 2 to ASP.NET 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From ASP.NET Web API 2 to MVC 6

@danroth27
Copy link
Member

There are a bunch of subtle changes to attribute routing in MVC 6 that need to be addressed somewhere. @rynowak is probably the best person to detail the main differences

@danroth27
Copy link
Member

There are a number of topics related to migrating Web API 2 code that are not addressed by this article:

  • Migrating HttpConfiguration logic to the MvcOptions pattern
  • Migrating message handlers to middleware
  • Migrating formatters to the new formatter model (less common)
  • Using the Microsoft.AspNet.Mvc.WebApiCompatShim package if you are porting a lot of Web API 2 code and you want to use the Web API 2 patterns (method overloading, HTTP verb convention based on method name, HttpRequestMessage/HttpResponseMessage programming model, etc).

@@ -25,6 +25,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseStaticFiles();
// Add MVC to the request pipeline.
app.UseMvc();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned previously, we recommend using attribute routing instead of trying to make things work with global routes.

It would be interesting to discuss this with you more and get your thoughts on this guidance.

ardalis added a commit that referenced this pull request Apr 8, 2015
Web api migration article, initial publication
@ardalis ardalis merged commit 49880aa into master Apr 8, 2015
@ardalis ardalis deleted the WebApiMigration branch April 8, 2015 15:28
scottaddie pushed a commit that referenced this pull request Apr 24, 2018
trobinson41 pushed a commit to trobinson41/Docs that referenced this pull request May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants