This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am working with a database that contains some tables with integer IDs, others with GUID IDs (uniqueidentifiers) I just noticed in your docs that you list as best practice "Use a single LightSpeedContext" But since I need to work with two types of identifiers, my workaround has been to use two contexts. Do you have any advice on a better way to handle this situation other than multiple contexts? |
|
|
You can specify identity methods at the entity level. For example, if most of your entities have GUID IDs, you could set the LightSpeedContext.IdentityMethod to IdentityMethod.Guid. So LightSpeed will use the Guid method by default. But then for each table with integer IDs, you could select that entity and set its Identity Method to, say, KeyTable. This will override the context default for that particular entity. (If you are hand-coding entities rather than using the designer, the equivalent is to apply TableAttribute and supply the IdentityMethod parameter.) |
|