Converting to .net core project

coder rock 336 Reputation points
2024-10-22T20:48:42.2+00:00

We have one asp.net mvc3 project running on production using ado.net and this 10 years old project and we have 10 years old client data in sql server, Now we are planing to move asp.net core.

So I have following question to converting asp.net mvc3 app to asp.net core

  1. What i have use asp.net core mvc or asp.net core api(Front Angular) for converting mvc3 app.
  2. If i will go with asp.net core mvc means both mvc3 razor view and core razor view will get less effort?
  3. I have already database with tables and stored procedures, and in my mvc3 app used ado.net to connect sql server but as per my knowledge in asp.net mvc core or core api we have to use entity framework or dapper then how to make this challenge
  4. What are the challenge to convert asp.net mvc3 to .net core technology
  5. In current project facing lot of performance issue in asp.net mvc3 app for that reason moving to .net core mvc or core api
  6. What are the Advantages to use .net core
  7. How Team Foundation Server(tfs) works and advantage with asp.net core
  8. How .net core useful support with AWS and Azure
  9. asp.net mvc razor view and .net core mvc razor view similar html tags?
  10. In existing project lot of sql store procedure used for calling lot reports and functionality can i use existing store procedure in .net core app?
  11. Asp.net core mvc or api which one best entity framework or dapper to connect sql server or i can use ado.net also?
  12. How to start quickly

Thanks in advance for you support

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,908 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,604 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,504 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 66,226 Reputation points
    2024-10-23T02:50:21.3933333+00:00

    if you pick a spa framework like angular (or react which I prefer) then you will just be using the asp.net core webapi, and this will be a big rewrite.

    ado.net is still fully supported, EF core and dapper are just wrappers. dapper is a lite wrapper that maps result sets to class objects. EF core is more of a true ORM. You can mix them. Your current database code should just work. You will need to decide if you want to migrate. I use dapper a lot (even in mvc 3) as its simpler code.

    asp.net core has two razor technologies, razor views which are very compatible with MVC 3 razor views, and razor pages which combine razor views and controller actions into a single page.

    converting mvc3 to pretty straight forward.

    • the binding is stricter and you may have a few issues. mvc3 converted query strings, form posts and json to name valued pairs, and had a name resolution order. asp.net core is more formal. if you mix query string and form posts, you will need to specify them binding source.
    • a common issue is there is no static access to HttpContext.
    • session access is asynchronous, and requests are not serialized as they were in mvc3
    • if you are a big WCF user, you are in for a disappointment. while the story is better than it was, it's still a second class citizen.

    tfs support is via your IDE, and has no impact on framework version. azure / aws deployments have better GitHub support. both azure and aws have good asp.net core support. Both charge less for linux / docker hosting.

    there are advantage to .net core.

    • you get the latest c# compiler, which has a lot of handy new features.
    • you can build websites hosted on linux.
    • the architecture is much better than webform/mvc.
    • it has strong support with a new release every year. this is also a disadvantage. as a LTS version is only supported for three years (a new LTS happens every two years), and you will be required to upgrade every couple years if you want support.
    • in general the performance is better

    for a quick start, you need to have a little understanding of injection as its used a lot. you can use the migration wizard on your code, but often it is easier to create a new core project and add the old code. I recommend converting all your libraries to .net standard 2.0 first. this allows them to work with old and new code. doing this will clean up any 4.8 dependencies and you can work out issues before migration.

    if you create sample, you want mvc and controllers.

    dotnet new mvc

    if you want to play with angular or react, there is a template for both. visual studio has more complex templates than dotnet, so you might want to use visual studio to create but to just pay try:

    dotnet new angular

    or

    dotnet new react

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. PatriceSc 171 Reputation points
    2024-10-23T16:50:27.4733333+00:00

    Hi,

    You could also consider to have a look at https://learn.microsoft.com/en-us/aspnet/core/migration/inc/overview?view=aspnetcore-8.0 which could allow to migrate in smaller steps (never tried it yet myself).

    Basically it allows the new version to handle requests and those not handled are forwarded to the old application.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.