That's possible. You should be able to send the entities and related graphs to the service and use these values with minimal changes or create a mapping between the entities and your previous classes. I honestly think it's quite a lot of work but hey if it's not broken why break it now? :)
EDIT:
I'll make a first try. Let's say we have an Ticket, TicketEntity (Entity Framework entity) and an TicketService. The TicketService has a method to update a booking or whatever. I am not familiar with ticket services so I am basically just guessing now. Feel free to correct me if I am wrong :)
public class TicketService
{
public TicketService()
{
public void InsertTicket(Ticket ticket)
{
// Logic remains the same
}
}
}
public class Ticket
{
private TicketEntity _entity;
public Ticket(TicketEntity entity)
{
_entity = entity;
}
public decimal Price
{
get { return _entity.Price }
}
public double GST
{
get { return _entity.GST }
}
}
public partial class TicketEntity
{
public decimal Price { get; set; }
public double GST { get; set; }
}
This is one approach. I am not saying it is right I am just saying this is one way of solving the issue of reusing the current services for updating and inserting tickets.
To use the ticket service from the business layer one would do something like.
public void Get(TicketEntity entity)
{
var context = new ObjectContext();
IList<TicketEntity> entities = (from t in context.TicketEntities
where t.Price > 200
select t).ToList();
foreach (var ent in entities)
{
var ticket = new Ticket(ent);
new TicketService().InsertTicket(ticket);
}
}