ASP.NET CORE - Some basics

ASP.NET CORE - Some basics

Sample Project based on this concept: https://www.dhirubhai.net/posts/prashant-pandya-a642324a_dotnetcore-activity-7182300417035296769-JlNG?utm_source=share&utm_medium=member_desktop


What is ASP.NET Core?

ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based, and internet-connected applications.

ASP.NET Core Features

Features include built-in dependency injection, unified MVC and Web API frameworks, and support for cross-platform development.

Advantages of ASP.NET Core

Advantages include improved performance, modular architecture, and cross-platform compatibility.

MVC Pattern

MVC (Model-View-Controller) is a design pattern used in ASP.NET Core for separating concerns in an application.

Understanding ASP.NET Core MVC

ASP.NET Core MVC is a framework for building web applications following the MVC pattern.

ASP.NET Core vs. ASP.NET MVC vs. ASP.NET Web Forms

ASP.NET Core is a newer, cross-platform framework compared to ASP.NET MVC and ASP.NET Web Forms, offering improved performance and flexibility.

Tools Needed

Required tools for ASP.NET Core development include Visual Studio, Visual Studio Code, .NET Core SDK, and relevant extensions.

.NET Community & Project Resources

Resources include official documentation, community forums, GitHub repositories, and NuGet packages.

Feedback Mechanisms

Feedback can be provided through GitHub issues, user forums, and community events.

Introduction to .NET Core

.NET Core is a cross-platform, open-source framework for building various types of applications.

Dependency Injection

Dependency injection is a technique used in ASP.NET Core for managing dependencies and promoting loose coupling.

Creating a Project

Projects in ASP.NET Core can be created using the dotnet new command or through IDEs like Visual Studio.

Hot Reload

Hot reload allows developers to make code changes without restarting the application, improving development productivity.

Project File & Launch Settings

Project files contain metadata about the project, while launch settings specify how the application should be launched during development.

wwwroot and app settings

wwwroot folder contains static files like CSS, JavaScript, and images, while app settings store configuration data.

Program Class File

The Program.cs file contains the entry point for the ASP.NET Core application.

MVC Architecture

MVC architecture separates an application into three main components: Model, View, and Controller.

Routing Overview

Routing maps URLs to controller actions in an ASP.NET Core MVC application.

Routing in Action

Routing in action involves defining routes and handling requests in ASP.NET Core MVC controllers.

Default Views & Tag Helper

Default views provide a default UI for common actions, while tag helpers simplify writing HTML in Razor views.

Action Result

Action results return responses to client requests in ASP.NET Core MVC controllers.

Here's a simple ASP.NET Core MVC project that covers the concepts mentioned:


dotnet new mvc -n MyAspNetCoreProject

cd MyAspNetCoreProject



  1. Dependency Injection: Open Startup.cs and you'll see services configured in ConfigureServices method.
  2. Routing: Open Startup.cs and navigate to Configure method where routes are configured.
  3. MVC Architecture: Check Controllers, Models, and Views folders. They represent the Model-View-Controller pattern.
  4. Default Views & Tag Helper: Look into Views folder. There are default views (Index.cshtml, About.cshtml, etc.) and you can use tag helpers like <a asp-controller="Home" asp-action="Index">Home</a> in Razor views.
  5. Action Result: Open a controller file (e.g., HomeController.cs). You'll see action methods like Index(), About(), etc., which return action results.
  6. Run the Project: Execute dotnet run command in the project directory. The application will start and you can access it in a web browser at https://localhost:5001.

This project is a basic example demonstrating the mentioned concepts. You can extend it further by adding more complex functionalities, models, views, and controllers according to your requirements.


Sample Project based on this concept: https://www.dhirubhai.net/posts/prashant-pandya-a642324a_dotnetcore-activity-7182300417035296769-JlNG?utm_source=share&utm_medium=member_desktop


要查看或添加评论,请登录

Prashant Pandya的更多文章

社区洞察

其他会员也浏览了