So basically I have it
public class Ticket{
public TicketNumber {get; set;}
..a bunch more properties...
}
I want to add some properties using a subclass like this, using assumption instead of composition.
public class TicketViewModel(Ticket ticket){
this.TicketNumber = ticket.TicketNumber;
...a bunch more lines of code..
public SelectList TicketTypes {get; private set;}
}
How to instantiate properties without having to write all lines like this
this.TicketNumber = ticket.TicketNumber;
Is there any shortcut? Something like a subclass constructor?
this = ticket;
Obviously this does not work, but it is their way, so I do not need to change my subclass if the addng / remove property of the parent class? Or something?
source
share