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
|
Hello - Using Mindscape 5 nightly build 5/20, VS 2012 Update 3, SQL Server 2008 R2 I created a view to return the info I need (see my previous post) but LS keeps insisting that there be a column called "Id" that is totally unnecessary. I will never create one of these. I've done this before, I have a view with no Id field that I use happily all over the place, but I can't remember what I did to make it work. Can you help me remember? I can't seem to find any difference in how the new entity is declared and how the original one is, yet the original one works without Id and the new one does not. Thanks, Dave |
|
|
Yes, this is the expected behaviour. If you want to materialise a row as an entity, it must have an Id which is unique as we track entities based on an Id. If you are only querying the view once within a UnitOfWork scope you could just use ROW_NUMBER to supply this. e.g.
|
|
|
Thanks, that did the trick. It took a little bit of trial and error to get ROW_NUMBER to work with the ORDER BY clause but it works like a charm now! |
|