c# - Refactoring code whilst using Entity Framework -


I have a small application that uses EF to continue my data.

Currently, I have a single 'ticket' class which goes directly to the 'ticket' table.

However, now there is a need to make different types of tickets (such as cruise tickets, airline tickets, train tickets), so I want my code to be rebroadced on the basis of these three ticket types. They are all received from the base ticket class.

Is it possible to make such refactoring while maintaining / modifying the existing database?

The feeling of my stomach is that it would be almost impossible to do this without rebooting my database again, and then copy the data from the existing database.

You will have to use tabletivity for this case EF will create one to two tables of the same < / P>

  [table ("ticket")] class ticket {{key] long id {get; Set;}} [table ("airtalk")] class airticket: ticket {string some special report} {get; Set;}} Here  

Here the table ticket will be a general list of all the columns.

Ticket Ticket = db.Ticket.Where (n = & gt; n .ID == ticketID). Before and after default (); // Ticket price will be a type of child (air or etc.)

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -