I have a small application that uses EF to persist my data.
At the moment I have a single 'Ticket' class that maps directly to a 'Ticket' table.
However, there is now a need to create different types of Ticket (e.g. Cruise Ticket, Airline Ticket, Train Ticket) so I'd like to refactor my code to have these 3 ticket types all inherit from a base ticket class.
Is it possible to perform this kind of refactoring whilst maintaining/modifying the existing database?
My gut feeling is that it would be almost impossible to do this without starting again from scratch by recreating my database, and then copying the data over from the existing database.
Typefield can suffice. In the code you can program differences in behavior by other patterns than inheritance.