GENERIC COLLECTIONS ASSIGNMENT
π· 1. π Library Management System
π§Ύ Question
Design a system to store books and their categories.
- Each book belongs to one category
- Display all books for a given category
- Find a book by ID
✅ Model Classes
class Category
{
public int CategoryId { get; set; }
public string CategoryName { get; set; }
}
class Book
{
public int BookId { get; set; }
public string Title { get; set; }
public string Author { get; set; }
public Category Category { get; set; }
}
π· 2. π E-Commerce Order System
π§Ύ Question
Design a shopping system where:
- A customer places orders
- Each order has multiple products
- Calculate total order amount
- Find a particular Order by ID
✅ Model Classes
class Product
{
public int ProductId { get; set; }
public string Name { get; set; }
public double Price { get; set; }
}
class OrderItem
{
public Product Product { get; set; }
public int Quantity { get; set; }
}
class Order
{
public int OrderId { get; set; }
public string CustomerName { get; set; }
public List<OrderItem> Items { get; set; }
}
π· 3. π Student Course System
π§Ύ Question
Design a system where:
- Students enroll in courses
- One student → one course
- Display all students in a specific course
- Find a particular Student by ID
✅ Model Classes
class Course
{
public int CourseId { get; set; }
public string CourseName { get; set; }
}
class Student
{
public int StudentId { get; set; }
public string Name { get; set; }
public Course Course { get; set; }
}
π· 4. π Vehicle Service Tracking
π§Ύ Question
Design a system to track vehicle services:
- Store vehicle details
- Track last service date
- Find vehicles not serviced in last 3 months
- Find a particular Vehcile by ID
✅ Model Classes
class Vehicle
{
public int VehicleId { get; set; }
public string Model { get; set; }
public string OwnerName { get; set; }
public DateTime LastServiceDate { get; set; }
}
π· 5. π¨ Hotel Booking System
π§Ύ Question
Design a booking system where:
- Customers book hotels
- Each hotel belongs to a city
- Display bookings by city
- Find a particular Booking by ID
✅ Model Classes
class Hotel
{
public int HotelId { get; set; }
public string HotelName { get; set; }
public string City { get; set; }
}
class Booking
{
public int BookingId { get; set; }
public string CustomerName { get; set; }
public Hotel Hotel { get; set; }
}
Comments
Post a Comment