Walaa wrote:
Not sure I understand you 100%.
ee.ID = "Some Unique Name"; // <-- This triggers a lookup/fetch
The ID gets a new Unique value, right?
Do you get this value from the database? If yes, I wonder why they are saved there.
Why not using an Identity field, or a UniqueIdentifier (GUID) field, or even set it toa unique GUID in code.
Ok, perhaps I should clarify:
The entity in question is a model of external data, and the PK is a hash of the entity fields that uniquely identifies the entity.
It is also a "leaf node" in an larger schema.
When I receive new data, I need to either:
- Create a new entity
- Update an existing entity
- Delete an existing entity
At first I tried using autoincrement PK:s, and called SaveMulti(true) on the root entity collection, and spent roughly 10 seconds waiting for less than 3000 rows to be written to the database.
Using computed PK:s I have been able to work around the slowness of SaveMulti(..) using SQLBulkCopy(), however, creating new entities is still a bottleneck.
Update and Delete I can do without problems. (Performance-wise)