see docs:
https://zcusa.951200.xyz/en-us/ef/ef6/modeling/code-first/workflows/existing-database
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
We have a web API that has been running smoothly for 3-4 years. Now I want to upgrade it to Core Web API. I use logging, basic authentication, OAuth, and Unity in my Web API. Will I have a lot of problems with the upgrade? May I have your advice and suggestions? What should I pay attention to?
Thank you.
common issues I have run into:
1) stricter binding rules
2) no xml request / response support by default
3) 3rd party library doesn't have .net standard or core support
4) use of HttpContext.Current (migrated to middleware)
5) session not locked (should not be using with webapi anyway)
Hi @Cenk ,
.NET Core is a cross-platform rewrite of .NET Framework. There are many breaking changes between the two frameworks. You can refer to this article to understand the differences between ASP.NET and ASP.NET Core.
Then, when migration, you could refer to the following articles to set the configuration, API controller and so on.
Migrate from ASP.NET to ASP.NET Core
Migrate from ASP.NET Web API to ASP.NET Core.
Besides, since you are using logging, basic authentication, OAuth, and Unity. For this package or class library, you also need to change. In many cases, a replacement NuGet package exists to fill in any gaps left between .NET Framework and .NET Core. In rare cases, you may need to find a third-party solution or implement new custom code to address incompatibilities.
[Note] When using or install the package, you'd better to check the package target framework, make sure it apply to the project version.
Here are some relates articles about logging, authentication, and Identity, you can refer to them:
Logging in .NET Core and ASP.NET Core
Introduction to Identity on ASP.NET Core
Simple authorization in ASP.NET Core
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion
I want to improve at the same time as upgrading. In my Asp.net Web API application, I was using class libraries for Business Entity, Business Service, and DataModels. If I change all these class libraries as folders within the new API project, will I gain anything besides reducing the complexity?
In my Asp.Net Web Api, I used code first with EF. I want to use the same database and the entities, should I use the database first approach? Can you help me?