|
1 | | -# DotNetWebAPI_InMemoryDatabase |
| 1 | +# DotNetWebAPI_InMemoryDatabase |
| 2 | + |
| 3 | +This is a simple .NET Web API project for managing books, created to explore .NET 8 with Entity Framework Core using an in-memory database. The project follows the repository pattern to handle book-related operations. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Introduction](#introduction) |
| 8 | +- [Features](#features) |
| 9 | +- [Prerequisites](#prerequisites) |
| 10 | +- [Getting Started](#getting-started) |
| 11 | +- [Usage](#usage) |
| 12 | +- [Contributing](#contributing) |
| 13 | +- [License](#license) |
| 14 | + |
| 15 | +## Introduction |
| 16 | + |
| 17 | +The project is a RESTful Web API that provides endpoints to perform CRUD operations on books. It utilizes Entity Framework Core with an in-memory database for data storage. |
| 18 | + |
| 19 | +## Features |
| 20 | + |
| 21 | +- **Get All Books**: Retrieve a list of all books. |
| 22 | +- **Add Book**: Add a new book to the database. |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | + |
| 26 | +Before you begin, ensure you have the following prerequisites: |
| 27 | + |
| 28 | +- .NET 8 SDK installed. [Download here](https://dotnet.microsoft.com/download) |
| 29 | +- An Integrated Development Environment (IDE) like Visual Studio or Visual Studio Code. |
| 30 | +- Git installed. [Download here](https://git-scm.com/downloads) |
| 31 | + |
| 32 | +## Getting Started |
| 33 | + |
| 34 | +1. Clone the repository: |
| 35 | + |
| 36 | + ```bash |
| 37 | + git clone https://github.com/RahulMule/DotNetWebAPI_InMemoryDatabase.git |
| 38 | + ``` |
| 39 | + |
| 40 | +2. Open the project in your preferred IDE. |
| 41 | + |
| 42 | +3. Build the solution. |
| 43 | + |
| 44 | +4. Run the application. |
| 45 | + |
| 46 | +## Usage |
| 47 | + |
| 48 | +The API provides the following endpoints: |
| 49 | + |
| 50 | +- **GET /api/books**: Retrieve a list of all books. |
| 51 | + |
| 52 | +- **POST /api/books**: Add a new book to the database. |
| 53 | + |
| 54 | + Example Request: |
| 55 | + ```json |
| 56 | + { |
| 57 | + "title": "The Great Gatsby", |
| 58 | + "description": "A novel by F. Scott Fitzgerald", |
| 59 | + "author": "F. Scott Fitzgerald", |
| 60 | + "price": 10.99 |
| 61 | + } |
| 62 | + ``` |
| 63 | + |
| 64 | + Example Response: |
| 65 | + ```json |
| 66 | + { |
| 67 | + "status": "OK" |
| 68 | + } |
| 69 | + ``` |
| 70 | + |
| 71 | +Feel free to explore and customize the code to suit your needs. |
| 72 | + |
| 73 | +## Contributing |
| 74 | + |
| 75 | +Contributions are welcome! Fork the repository, make your changes, and submit a pull request. |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments