RESTful ASP.NET Core Web API for product and inventory management using SQL Server and Entity Framework Core.
This project demonstrates a complete backend CRUD system built with professional backend development practices using ASP.NET Core, Entity Framework Core, and SQL Server integration.
- Create products
- Retrieve all products
- Retrieve products by ID
- Update existing products
- Delete products
- SQL Server database integration
- Entity Framework Core ORM
- Swagger/OpenAPI documentation
- RESTful architecture
- Dependency Injection
- Asynchronous database operations using async/await
- ASP.NET Core Web API
- C#
- Entity Framework Core
- SQL Server
- Swagger / OpenAPI
- Visual Studio
- Git & GitHub
The project follows a layered backend structure commonly used in enterprise applications.
ProductApi
│
├── Controllers/
│ └── ProductsController.cs
│
├── Models/
│ └── Product.cs
│
├── Data/
│ └── AppDbContext.cs
│
├── screenshots/
│
├── Program.cs
├── appsettings.json
└── ProductApi.sln
The API is connected to a SQL Server database using Entity Framework Core.
The Products table stores product information persistently and supports full CRUD operations through the API endpoints.
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}| Method | Endpoint | Description |
|---|---|---|
| GET | /Api/Products |
Get all products |
| GET | /Api/Products/{id} |
Get product by ID |
| POST | /Api/Products |
Create a product |
| PUT | /Api/Products/{id} |
Update a product |
| DELETE | /Api/Products/{id} |
Delete a product |
Swagger UI is enabled during development for interactive API testing.
The following image shows the SQL Server table storing product data successfully.
The project uses Dependency Injection to register the database context inside Program.cs.
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(
builder.Configuration.GetConnectionString("DefaultConnection")));git clone https://github.com/AdrielHa/CrudApi.gitOpen:
ProductApi.sln
using Visual Studio.
Update the connection string inside:
appsettings.json
Example:
"ConnectionStrings": {
"DefaultConnection": "Server=localhost\\SQL2025;Database=ProductDB;User Id=YOUR_USER;Password=YOUR_PASSWORD;TrustServerCertificate=True;"
}Press:
F5
or click:
Start Debugging
Swagger will open automatically.
This project was built to practice:
- ASP.NET Core backend development
- REST API architecture
- SQL Server integration
- Entity Framework Core
- CRUD operations
- Dependency Injection
- Asynchronous programming
- API testing with Swagger
Adriel Yulissa Hernández Albarrán
Background in Physics with experience in:
- Scientific computing
- Data analysis
- Backend development
- Numerical modeling
- Experimental data visualization



