This is a shopping list application developed using C#, .NET, and ASP.NET. It allows users to manage their shopping lists, products, and shopping carts.
- Create, read, update, and delete shopping lists.
- Create, read, update, and delete products.
- Create, read, update, and delete shopping carts.
- Add and remove products from shopping carts.
- Add and remove shopping carts from shopping lists.
- Update the quantity of a product in a shopping cart.
- Calculate the total price of shopping lists and shopping carts.
- C#
- .NET
- ASP.NET
- Microsoft.AspNetCore.Mvc
- Entity Framework Core
- SQLite
- Clone the repository:
git clone https://github.com/louresb/SmartShopListApp
- Navigate to the project directory:
cd SmartShopListApp
- Build the project:
dotnet build
- Run the project:
dotnet run
- Access the application through the URL: https://localhost: <port>
GET /api/product
- Get all products.GET /api/product/{id}
- Get a product by ID.POST /api/product
- Create a new product.PUT /api/product/{id}
- Update a product by ID.DELETE /api/product/{id}
- Delete a product by ID.
GET /api/shoppingcart
- Get all shopping carts.GET /api/shoppingcart/{id}
- Get a shopping cart by ID.POST /api/shoppingcart
- Create a new shopping cart.POST /api/shoppingcart/{cartId}/addproduct/{productId}
- Add a product to a shopping cart.PUT /api/shoppingcart/{id}
- Update a shopping cart by ID.PUT /api/shoppingcart/{cartId}/updateproduct/{productId}
- Update the quantity of a product in a shopping cart.DELETE /api/shoppingcart/{id}
- Delete a shopping cart by ID.DELETE /api/shoppingcart/{cartId}/removeproduct/{productId}
- Remove a product from a shopping cart.
GET /api/shoppinglist
- Get all shopping lists.GET /api/shoppinglist/{id}
- Get a shopping list by ID.POST /api/shoppinglist
- Create a new shopping list.POST /api/shoppinglist/{listId}/addcart
- Add a shopping cart to a shopping list.PUT /api/shoppinglist/{id}
- Update a shopping list by ID.DELETE /api/shoppinglist/{id}
- Delete a shopping list by ID.DELETE /api/shoppinglist/{listId}/removecart/{cartId}
- Remove a shopping cart from a shopping list.
To create a new shopping cart, send a POST request to /api/shoppingcart
with the following JSON payload:
{
"name": "My Shopping Cart",
"shoppingListId": 1
}
To get all products, send a GET request to /api/list
.
To add a product to the shopping cart send a Post request to /api/shoppingcart/{shoppingcartId}/addproduct/{productId}
with the following JSON payload:
{
"quantity": 3
}
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.