https://github.com/basuru07/product-management
https://github.com/basuru07/product-management
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/basuru07/product-management
- Owner: basuru07
- Created: 2025-08-11T05:01:25.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-12T06:26:54.000Z (11 months ago)
- Last Synced: 2025-08-12T07:21:37.907Z (11 months ago)
- Language: C#
- Size: 14.5 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Product Management API
A simple .NET Core Web API for managing products using Clean Architecture.
## Features
- Create, Read, Update, Delete products
- Check stock availability
- Clean Architecture with 3 layers
- Swagger documentation
## Product Properties
- **Id**: Auto-generated number
- **Name**: Product name
- **Description**: Product details
- **Price**: Product price
- **StockQuantity**: Available stock
- **CreatedDate**: When created
- **UpdatedDate**: When last modified
## API Endpoints
| Method | URL | Description |
|--------|-----|-------------|
| GET | `/api/product` | Get all products |
| GET | `/api/product/{id}` | Get one product |
| POST | `/api/product` | Create product |
| PUT | `/api/product/{id}` | Update product |
| DELETE | `/api/product/{id}` | Delete product |
4. **Run**
```bash
dotnet run --project ProductManagement.API
```
## Project Structure
```
ProductManagement/
├── ProductManagement.API/ # Controllers, DTOs
├── ProductManagement.Core/ # Business logic, Models
└── ProductManagement.Infrastructure/ # Database, Repositories
```
## Test API
Go to: `https://localhost:7001/swagger`
## Sample Request
**Create Product:**
```json
POST /api/product
{
"name": "Smartphone",
"description": "Latest smartphone",
"price": 899.99,
"stockQuantity": 25
}
```
**Response:**
```json
{
"id": 1,
"name": "Smartphone",
"description": "Latest smartphone",
"price": 899.99,
"stockQuantity": 25,
"createdDate": "2025-12-08T11:00:43.347"
}
```