ASP.NET Core Tutorial – Application with CRUD Operations

By | December 13, 2017
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest

In this article, we will implement CRUD (Create, Retrieve, Update, Delete) operations using ASP.NET MVC Core application with Entity Framework Core. We will take “Product” entity as reference for implementation purpose. In our previous ASP.NET Core Tutorial, we have discussed in details about the basics concepts and details related to ASP.NET Core including primary features, ASP.NET Core Initialization Process, Configuration Model, ASP.NET Core Middle-ware, Routing in ASP.NET Core and more. We strongly recommend to go through it for better understanding.

Below are the Prerequisites for understanding and executing the ASP.NET Core application.

  1. Microsoft Visual Studio 2015.
  2. VS 2015 Tooling Preview 2 – .NET Core 1.0.0 (https://go.microsoft.com/fwlink/?LinkID=827546)
Entity Framework in Depth: The Complete Guide
Entity Framework in Depth: The Complete Guide
Connect your applications to a SQL Server database. Understand the differences between code-first and database-first workflows….
Build a Real-world App with ASP.NET Core and Angular 2 (4+)Build a Real-world App with ASP.NET Core and Angular 2 (4+)
ASP.NET Core and Angular 2(4+) is an ideal combination for building real world modular and cloud-optimized applications.

Lets start to perform CRUD Operations in this ASP.NET core Tutorial

Below steps guide you to creating a new project.

  1. Open and start Visual Studio 2015.
  2. Click on File -> New -> Project.Visual Studio 2015 New Project
  3. Click on “OK”.Visual Studio Project TemplateSelect “Empty” template and Click on “OK”.
  4. The new empty solution will be open in your window.ASP.NET Core Application Tutorial
  5. The Solution Explorer window for that project is defined as belows:ASP.NET Core Solution
  6. For running the application, you first need to change the database connection string. Open “appsettings.json” file.ASP.NET Core AppSettings.jsonYou need to be change the connection string as per your system.
  7. In Package Manager Console, type “Update-Database”.  This command creating a new database in your system as per your connection string.
  8. Database snapshot is as below:ASP.NET Core Application DB
  9. Right click on solution, and Rebuild the solution.
  10. We have move forward to understand creation of Entity, its’ snapshot, Listing page, Creation page, Editing page and Deleting a record in below section.
    “Product” Entity Section:
    Startup and configuration file Section:

    Startup and Configuration FileListing Screen Section
    1. Cshtml Page:Listing Page2. Controller Action Method:
    Listing ActionMethod3. Output screen:
    Product Application Listing

    Creation/Modifying Section:
    1. Cshtml page
    Add Modify ASP.NET Core App2. Create/Edit Controller Action Methods
    Modify ActionMethod3. Output screenNew App ASP.NET Core
    CRUD Operations in ASP.NET Core
    Delete Section:

    1. Cshtml PageDelete Product ASP.NET Core2. Delete Controller Action MethodsDelete Action Method3. Output screenDelete Output

This ASP.NET Core Tutorial can be taken as a first step towards creating a professional application using ASP.NET Core with Entity Framework using C#.

ASP.NET Core with Angular 2
Build a Real-world App with ASP.NET Core and Angular 2 (4+)

  • Build a full-stack web app with ASP.NET Core, Entity Framework Core and Angular 2 & 4.
  • Implement a Clean & Decouple Architecture.
  • Properly implement the repository and unit of work patterns.
  • Troubleshoot common runtime errors.
  • Test APIs using PostMan.
  • Integrate ASP.NET MVC/Core with Angularjs.
  • Understand and apply the Dependency Inversion Principle (DIP).
  • Use the new dependency injection feature in ASP.NET Core.
  • Build APIs with ASP.NET Core
  • and more….

Take this Online Course at Discounted Price

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInDigg thisPin on Pinterest