Hello Leandro Vidal,
Can you please share some more information regarding your model? Does your client object use Auto-increment mechanism for generating its key? If so, you should care for the following scenario:
The client object does not know its id until a round trip to the database is done (because the ID is generated by the database itself). Having that in mind, when setting the client reference to your Contact object the client has ID equaling 0. This might rise an exception and the entry will not be added. Please call ObjectScopeProvider1.ObjectScope().Transaction.Flush()
after each insert. This will ensure that each entry does the necessary roundtrip to the database and thus knows its ID. Please note that the flush
does not commit the transaction but rather temporary pushes the data to the server and allows you to perform a rollback at a later stage.
the Telerik team