Skip to content

tofigamraslanov/car-rental

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CarRental - Car Rental Project

📌Getting Started

An exemplary project for Car Rental workplaces, which is prepared with N-Layered architecture. The project developed using SOLID design principles in the CSharp programming language. CRUD operations are performed using Entity Framework Core.

📚Layers

Entities Layer

The entities layer is a layer where we store our database data. We have three folders Abstract, Concrete and DTOs in the Entities layer. The abstract folder is used to store abstract objects (e.g Interfaces) while the concrete folder is used to store concrete objects (e.g Classes).The DTOs folder is used to store Data Transmission Objects (CarDetailDto)

📂Abstract
   📃 IEntity.cs

📂Concrete
   📃 Brand.cs
   📃 Car.cs
   📃 Color.cs
   📃 Customer.cs
   📃 Rental.cs
   📃 User.cs

📂DTOs
   📃 CarDetailDto.cs
   📃 RentalDetailDto.cs

Business Layer

This layer coordinates the application, processes commands, makes logical decisions and evaluations, and performs calculations. It also moves and processes data between the two surrounding layers -DataAccess and Presentation. We have 5 folders Abstract, Concrete, Constants, Dependency Resolvers and ValidationRules in the Business Layer.

📂Abstract
   📃 IBrandService.cs
   📃 ICarService.cs
   📃 IColorService.cs
   📃 ICustomerService.cs
   📃 IUserService.cs

📂Concrete
   📃 BrandManager.cs
   📃 CarManager.cs
   📃 ColorManager.cs
   📃 CustomerManager.cs
   📃 UserManager.cs

📂Constants
   📃 Messages.cs

📂DependencyResolvers
    📂Autofac
        📃 AutofacBusinessModule.cs

📂ValidationRules
    📂FluentValidation
       📃 BrandValidator.cs
       📃 CarValidator.cs
       📃 ColorValidator.cs
       📃 CustomerValidator.cs
       📃 RentalValidator.cs

Core Layer


📂Aspects
   📂Autofac
      📂Validation
          📃 ValidationAspect.cs

📂Business
    📃 IService.cs

📂CrossCuttingConcerns
   📂Validation
      📃 ValidationTool.cs

📂DataAccess
   📂EntityFramework
      📃 EfEntityRepositoryBase.cs
    📃 IEntityRepository.cs

📂Entities
    📃 IDto.cs
    📃 IEntity.cs

📂Utilities
   📂Interceptors
      📃 AspectInterceptorSelector.cs
      📃 MethodInterception.cs
      📃 MethodInterceptionBaseAttribute.cs
   📂Results
      📃 DataResult.cs
      📃 ErrorResult.cs
      📃 ErrorDataResult.cs
      📃 IDataResult.cs
      📃 IResult.cs
      📃 Result.cs
      📃 SuccessDataResult.cs
      📃 SuccessResult.cs

Tables in Database

Cars Rentals Users
Variable Name Data Type
Id int
BrandId int
ColorId int
ModelYear int
DailyPrice decimal
Description nvarchar(50)
Variable Name Data Type
Id int
CarId int
CustomerId int
RentDate datetime
ReturnDate datetime
Variable Name Data Type
Id int
FirstName nvarchar(50)
LastName nvarchar(50)
Email nvarchar(50)
Password nvarchar(50)
Customers Brands Colors
Variable Name Data Type
UserId int
CustomerName nvarchar(50)
Variable Name Data Type
Id int
BrandName nvarchar(50)
Variable Name Data Type
Id int
ColorName nvarchar(50)