Inheritance is about building on top of a foundation. In C#, the base keyword is how a derived (child) class reuses, extends, or clarifies behavior defined in its base (parent) class.
This post delivers a practical, end-to-end understanding of base in three places you’ll use it most:
Call the base class constructor
Access (and extend) base class methods
Access base class properties and fields
In a ticketing system, you may have multiple layers of tickets:
Base Ticket: The fundamental ticket with an ID and issue date.
Event Ticket: Adds event name and seat info.
VIP Ticket: Extends further with perks like lounge access or free snacks.
Step 1: Calling the Base Constructor
Every ticket must have a TicketId and IssueDate. That’s our base.
public class Ticket
{
public string TicketId { get; }
protected DateTime IssueDate { get; }
public Ticket(string ticketId)
{
TicketId = ticketId;
IssueDate = DateTime.UtcNow;
Console.WriteLine($"[Ticket] Issued Ticket #{TicketId} on {IssueDate:d}");
}
public virtual void PrintDetails()
{
Console.WriteLine($"Ticket #{TicketId}, Issued: {IssueDate:d}");
}
}
Now, when we create an EventTicket, it should still initialize as a Ticket first.
👉 That’s where : base(ticketId) comes in.
public class EventTicket : Ticket
{
public string EventName { get; }
public string SeatNumber { get; }
public EventTicket(string ticketId, string eventName, string seatNumber)
: base(ticketId) // ✅ call base constructor
{
EventName = eventName;
SeatNumber = seatNumber;
Console.WriteLine($"[EventTicket] Event: {EventName}, Seat: {SeatNumber}");
}
}
Usage
https://medium.com/@dotnetfullstackdev
var basic = new EventTicket("T1001", "Jazz Night", "A12");
Output
[Ticket] Issued Ticket #T1001 on 9/7/2025
[EventTicket] Event: Jazz Night, Seat: A12
👉 Transition: A ticket is always born as a basic ticket first, then becomes specialized.
Step 2: Accessing and Extending Base Methods
The base ticket can print its details. But the event ticket wants to add event info.
public class EventTicket : Ticket
{
public string EventName { get; }
public string SeatNumber { get; }
public EventTicket(string ticketId, string eventName, string seatNumber)
: base(ticketId)
{
EventName = eventName;
SeatNumber = seatNumber;
}
public override void PrintDetails()
{
base.PrintDetails(); // ✅ reuse base printing
Console.WriteLine($"Event: {EventName}, Seat: {SeatNumber}");
}
}
Usage
basic.PrintDetails();
Output
Ticket #T1001, Issued: 9/7/2025
Event: Jazz Night, Seat: A12
Transition: We didn’t throw away the parent’s printing logic — we extended it with event data.
Step 3: Accessing Base Properties and Fields
Now we add a VIP Ticket. It still has event details, but also perks.
Notice that the base ticket had a protected IssueDate. We can access it in derived classes to enrich the output.
public class VipTicket : EventTicket
{
public string Perks { get; }
public VipTicket(string ticketId, string eventName, string seatNumber, string perks)
: base(ticketId, eventName, seatNumber) // ✅ base constructor
{
Perks = perks;
}
public override void PrintDetails()
{
base.PrintDetails(); // ✅ call parent details
Console.WriteLine($"VIP Perks: {Perks}");
Console.WriteLine($"(Issued originally on {IssueDate:d})"); // ✅ base field
}
}
Usage
var vip = new VipTicket("T2001", "Rock Concert", "B5", "Lounge + Free Drinks");
vip.PrintDetails();
Output
Ticket #T2001, Issued: 9/7/2025
Event: Rock Concert, Seat: B5
VIP Perks: Lounge + Free Drinks
(Issued originally on 9/7/2025)
Transition: The VIP ticket doesn’t reinvent — it inherits everything, calls base, and adds perks.
Recap
We’ve seen base evolve naturally in a Ticketing System:
Call base constructor → A ticket always starts as a
Ticketbefore being an Event or VIP ticket.Access and extend methods → Event and VIP tickets reuse
PrintDetails()before adding their own info.Access base properties/fields → VIP ticket can display the inherited
IssueDate.
Key Takeaway
The base keyword is your bridge to the parent class:
Ensures core initialization (constructor).
Preserves parent functionality (methods).
Grants access to inherited state (fields/properties).
Think of it like a ticketing upgrade path:
Every ticket starts as a base ticket.
You reuse the core details.
You extend it into richer experiences (event seating, VIP perks).
That’s base in action — layered, reusable, and consistent.


