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 have a stored proc that takes a single param. It's mapped to an entity DisplayDepot. The proc returns 2 records. Using the following I get 2 records, but they are identitcal - both have id = 1 when it should be 1 & 2.
using (var unitOfWork = dataContext.CreateUnitOfWork()) Is this a bug? Ta |
|
|
It may be a mapping issue, where LightSpeed is mapping the wrong column to the identity, and both records have 1 in that column. (And when LightSpeed sees "identity" 1 for the second row, it gets the existing "ID 1" from the identity map rather than materialising a new entity.) In LightSpeed 2.2 RTM, I think the ID had to be the first column returned from the stored procedure. In current nightlies, I think it can be any column, but it must still be named "Id" or whatever the entity overrides that to be via TableAttribute.IdColumnName. My guess would be that your stored procedure doesn't return a column that LightSpeed is able to recognise as the identity, and that it may be falling back on the first column as the identity, but that first column actually contains business data (which happens to be 1 in both cases). Does that sound plausible? If this doesn't help, I think we'd probably need to see the sproc definition (or at least the column list) and ideally the underlying data that you're expecting to get back. |
|
|
Shazam! Fixed. Thank you! |
|