If an object is inserted 1 at a time, then the Id can be fetched from the object:
foreach (var object in objectList)
{
conn.Insert(object);
int id = object.Id; // Returns Id as expected
}
However, if an IEnumerable of objects is inserted, the Ids cannot be fetched properly:
conn.Insert(objectList);
foreach (var object in objectList)
{
int id = object.Id; // Returning 0
}
Is there a way to insert the list of objects and still get the Ids back without inserting 1 at a time?