To keep working in an application with data from database, I'm using linq2db.
The insertion of an object in DB was expected to insert WITH ID if that object has one, and to create new ID in DB for this object if there is no identity.
But for now, this method is inserting new id in both cases.
I can give you an example:
using(var db = new EIDB())
{
Customer.Id=20;
Customer.Name="Greg";
db.Insert(Customer);
}
After this insertion, we have in DB this customer with name "Greg" and ID=1...
***Is there a way to do something similar, but to insert the same ID that was set before(in our example = 20)?
PS: If I'm using NpgsqlCommand, and inserting the same data, is inserting with ID=20...