This question is locked. New answers and comments are not allowed.
Hello. I have this code:
public void Save(Client client, List<Contact> contactList)
{
ObjectScopeProvider1.ObjectScope().Transaction.Begin();
ObjectScopeProvider1.ObjectScope().Add(client);
foreach (Contact c in contactList)
{
c.Client = client;
ObjectScopeProvider1.ObjectScope().Add(c);
}
ObjectScopeProvider1.ObjectScope().Transaction.Commit();
}
When I execute this code and I see the database, only the Client has been added, there's not any contact in the table. What's wrong?
Thanks!
public void Save(Client client, List<Contact> contactList)
{
ObjectScopeProvider1.ObjectScope().Transaction.Begin();
ObjectScopeProvider1.ObjectScope().Add(client);
foreach (Contact c in contactList)
{
c.Client = client;
ObjectScopeProvider1.ObjectScope().Add(c);
}
ObjectScopeProvider1.ObjectScope().Transaction.Commit();
}
When I execute this code and I see the database, only the Client has been added, there's not any contact in the table. What's wrong?
Thanks!