Rent a Car is a car rental solution. This project includes an enterprise-grade solution for building RESTful services using ASP.NET WebAPI and C#.
-
Clone the repo:
git clone https://github.com/yusufsafaa/RentACar.git
-
Open the
ReCapProject.slnfile withVisual Studio -
Open the
CarRentalContext.csfile in theDataAccess.Concrete.EntityFrameworkfolder and enter your own database connection string -
Open
Package Manager Consoleand run the following commands:cd DataAccess dotnet ef database updateNOTE:Requiresdotnet efinstallation. Command for installation:dotnet tool install --global dotnet-ef
-
Right click on the
WebAPIproject (layer) from theSolution Explorerand selectSet as Startup Project -
Start the project with
IIS Expressin Visual Studio. Web API is ready and running!
After running the Web API, you can make HTTP requests like:
https://localhost:7291/api/`CONTROLLER_NAME`/`METHOD_NAME`CONTROLLER_NAME => Each .cs file located in the WebAPI.Controllers folder (For example CONTROLLER_NAME for CarsController: cars )
METHOD_NAME => All of the methods in each .cs file in the WebAPI.Controllers folder
- List all vehicles:
https://localhost:44372/api/cars/getall
- List a brand by id:
https://localhost:44372/api/cars/getdetailbycarid?carId=1 - List all vehicle colors:
https://localhost:44372/api/colors/getall
| Technology / Library | Version |
|---|---|
| .NET | 7.0 |
| Autofac | 7.0.1 |
| Autofac.Extensions.DependencyInjection | 8.0.0 |
| Autofac.Extras.DynamicProxy | 7.1.0 |
| FluentValidation | 11.6.0 |
| Microsoft.AspNetCore.Authentication.JwtBearer | 7.0.9 |
| Microsoft.AspNetCore.Http | 2.2.2 |
| Microsoft.AspNetCore.Http.Abstractions | 2.2.0 |
| Microsoft.AspNetCore.Features | 5.0.17 |
| Microsoft.EntityFrameworkCore.Design | 5.0.8 |
| Microsoft.EntityFrameworkCore.SqlServer | 7.0.10 |
| Microsoft.EntityFrameworkCore.Configuration | 5.0.0 |
| Microsoft.EntityFrameworkCore.Configuration.Binder | 7.0.4 |
| Microsoft.IdentityModel.Tokens | 6.12.2 |
| Newtonsoft.Json | 13.0.3 |
The frontend of this project RentACarFrontend
Thanks to dear Engin Demiroğ for his contributions.