Tours Project Server is a robust, multi-layered .NET 9 solution for managing flights, customers, orders, destinations, and related business logic for a travel or airline management system. The project is architected using a clean separation of concerns, leveraging a layered architecture with Data Access Layer (DAL), Business Logic Layer (BL), and a RESTful Web API (Server).
- Purpose: Handles all direct interactions with the SQL Server database using Entity Framework Core.
- Key Components:
- Models: Represent database tables (e.g.,
Flight,Order,Class,Customer,ClassToFlight, etc.). - Services: Implement CRUD operations for each entity.
- DalManager: Centralizes access to all DAL services.
- dbcontext: Entity Framework context mapping all tables and relationships.
- Models: Represent database tables (e.g.,
- Purpose: Implements business rules, validation, and data transformation between the DAL and the API.
- Key Components:
- Models: Business representations of entities (e.g.,
BlFlight,BlOrder, etc.). - Services: Contain business logic and orchestrate DAL operations.
- BlManager: Centralizes access to all BL services.
- Interfaces: Define contracts for business operations.
- Models: Business representations of entities (e.g.,
- Purpose: Exposes the system's functionality via RESTful HTTP endpoints for client applications.
- Key Components:
- Controllers: Handle HTTP requests for each entity (e.g.,
FlightController,OrdersController,ClassToFlightController, etc.). - Program.cs: Configures the web server, dependency injection, CORS, and Swagger for API documentation.
- Controllers: Handle HTTP requests for each entity (e.g.,
- Flight Management: Create, update, delete, and retrieve flights and their details.
- Order Management: Manage customer orders, including order details and associations with flights.
- Customer Management: Register, update, and manage customer information.
- Class & ClassToFlight Management: Handle flight classes (e.g., economy, business) and their assignment to specific flights.
- Destination Management: Manage flight destinations and related data.
- Advanced Queries: Retrieve flights by source, destination, date, and more.
- Robust Error Handling: Consistent error responses and validation across all endpoints.
- Swagger Integration: Interactive API documentation and testing.
- .NET 9
- ASP.NET Core Web API
- Entity Framework Core
- SQL Server (LocalDB)
- Dependency Injection
- Swagger/OpenAPI
Tours-Project-Server/ ? ??? Dal/ # Data Access Layer (EF models, services, context) ??? BL/ # Business Logic Layer (business models, services, interfaces) ??? Server/ # Web API (controllers, Program.cs) ??? database/ # SQL Server .mdf file (LocalDB)
- Clone the repository
- Ensure .NET 9 SDK is installed
- Configure the database connection string
- The default connection string is set for LocalDB in
dbcontext.cs. - Update as needed for your environment.
- The default connection string is set for LocalDB in
- Build and run the solution
- Use Visual Studio or
dotnet build/dotnet runfrom the command line.
- Use Visual Studio or
- Access the API
- Swagger UI is available at
https://localhost:<port>/swaggerfor interactive exploration.
- Swagger UI is available at
- Flights:
/api/Flight - Orders:
/api/Orders - Customers:
/api/Customers - ClassToFlight:
/api/ClassToFlight - Class:
/api/Class - Destinations:
/api/Destinition - OrdersDetails:
/api/OrdersDetails - ThisFlight:
/api/ThisFlight
Each controller supports standard CRUD operations and advanced queries as appropriate.
- Add new entities: Define models in DAL and BL, implement services, and expose via a new controller.
- Business rules: Implement or update logic in BL services.
- Database migrations: Use Entity Framework Core tools for schema updates.
- Connection Strings: Move sensitive data out of source code and into configuration files or environment variables.
- Validation: All controllers validate input and return appropriate HTTP status codes.
- CORS: Configured to allow all origins for development; restrict in production as needed.
This project is for educational and demonstration purposes.
For production use, review and update security, error handling, and deployment practices.
- Developed by Yocheved Koren.
For questions or support, please send an email to the following address: chevi4564@gmail.com.
=======
08157ded3b171cfb7b47923106ad4f3d15f7e425