new baby for asp.net core mvc

coder rock 436 Reputation points
2024-10-26T19:46:52.35+00:00

Hi all my all previous experience is using asp.net MVC, asp.net web, API and angular but recently I have install .NET 8 SDK and created asp.net core MVC empty project and i have following doubts.

  1. how to make authentication and authorization using asp.net core MVC
  2. State management in asp.net core MVC
  3. what i have to use to call sql server ado.net or dapper or EF which one is best.
  4. I have to use any design pattern. if yes give any examp
Developer technologies ASP.NET ASP.NET Core
Developer technologies ASP.NET Other
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-10-26T21:10:23.8+00:00

    Authentication is the same as old MVC, although if you used membership, it was retired even in the old framework.

    https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/membership-to-core-identity?view=aspnetcore-8.0

    state management is the same, except session management is now async.

    unless you were using entity framework, which should be migrated to EF core, database access is the same. If you are currently database first, and use stored proc, then ado.net or dapper would probably be best. Use dapper if you want binding to objects. If you want to switch to code first then use EF core.

    without knowing you design requirements, hard to recommend with patterns. Asp.net core already pushes injection, and EF core is the repository pattern along with ORM support. The saga pattern is handy if you use microservices and are cloud based (would not recommend for onprem as you need a reliable queuing service).

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. AgaveJoe 30,126 Reputation points
    2024-10-27T11:51:25.6033333+00:00
    1. how to make authentication and authorization using asp.net core MVC

    https://learn.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-8.0&tabs=visual-studio

    1. State management in asp.net core MVC

    https://learn.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-8.0

    3 what i have to use to call sql server ado.net or dapper or EF which one is best.

    You asked the same question in a previous thread. Rather than duplicating your questions, can you tell us specifically what you are still struggling to understand?

    Entity Framework is a complete object-relational mapper (ORM) and unit-of-work. You get to interact with a database using C# objects.

    https://learn.microsoft.com/en-us/aspnet/entity-framework

    Dapper is a lightweight ORM that lets you write your own queries and maps the results to an object. If you take a few hours to paly with EF and Dapper you're get the idea pretty quickly.

    1. I have to use any design pattern. if yes give any example

    The ASP.NET Core fundamentals documentation covers the official programming patterns that are found in ASP.NET Core. Dependency inject is a main concept in ASP.NET Core and one that you'll use when creating services. The factory and singleton patterns are common in ASP.NET Core and also covered the official documentation. MVC and Razor Pages are themselves programming patterns and EF is a unit of work pattern.

    https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-8.0

    As stated above there are many design patterns to choose from other than the patterns common to ASP.NET Core. Each design pattern solves common programming problem. If you can give us a programming problem that you are trying to solve, then we can point you to a design pattern. Otherwise, take some time to learn design patterns.

    https://www.dofactory.com/net/design-patterns

    0 comments No comments

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.