CRUD REST API with ASP.NET Core & Entity Framework Core If you already know Node.js, Express and PostgreSQL , ASP.NET Core can initially look more complicated than Express. The underlying REST API flow, however, is very similar. In this tutorial, we will build a backend-only Users CRUD API and continuously map the .NET approach to the Express concepts you already know. Project style: Controller-based ASP.NET Core Web API, PostgreSQL, Entity Framework Core and Npgsql. We will not create a .sln file. 1. What We Will Build Method Endpoint Purpose GET /api/users Get all users POST /api/users Create a user PUT /api/users/{id} Update a user DELETE /api/users/{id} Delete a user 2. Express vs ASP.NET Core Flow Express: Request ↓ Express Route ↓ pg / Pool ↓ PostgreSQL ASP.NET Core: Request ↓ Controller ↓ AppDbContext ↓ En...
Build a Basic CRUD App with PostgreSQL, Express and React In this beginner project, we will create a simple users application using PostgreSQL, Express.js, Node.js and React.js. We will divide the application into small steps so that the complete flow is easy to understand. Action Method API Show users GET /api/users Add user POST /api/users Edit user PUT /api/users/:id Delete user DELETE /api/users/:id Step 1: Create the Database Open pgAdmin. Right-click Databases , select Create → Database , enter users_crud_db , and save it. Step 2: Open the Query Tool Select users_crud_db and open Tools → Query Tool . Step 3: Create the Users Table Run the following SQL query: users.sql SQL CREATE TABLE users ( id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(150) NOT NUL...