I can't find the solution for the following problem..
I have Three Classes, all this making the reverse mapping and all the Id are identity in the tables.
When I try to make this:
var oTicket =
var oItem =
oItem.ItemId = 8;
oItem.Quantity = 10;
var oProfessional =
oProfesional.ProfessionalId = 2;
And I get a exception with the id from Ticket in ItemInTicket and ProfessionalInTicket.
Sql Server Profiler show me that the Ticket insert is done but when try to insert ItemInTicket the Id of TicketId is 0.
Could someone help me on this.
Thanks in advance.