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've got some inheritance going on. Profile -> UserProfile, implemented using [Discriminator(Attribute="ProfileTypeId", Value=USER_PROFILE_TYPE)].
When I do a find all QueryExpression query = Entity.Attribute( "Id" ) > 0 && Entity.Attribute( "Id" ) < 1000; IList<UserProfile> userProfiles = Repository.Find<UserProfile>( query ); I get all Profiles returned, not just the UserProfiles. This also results in validation errors on the UserProfile since all Profile has many null able attributes that are required in UserProfile. Do I have to adjust the query to QueryExpression query = Entity.Attribute( "Id" ) > 0 && Entity.Attribute( "Id" ) < 1000 && Entity.Attribute( "ProfileTypeId" ) == USER_PROFILE_TYPE; or does light speed cater for this scenario and I just need to amend my Profile and UserProfile domain objects? |
|
|
Hi Johannes, Currently, you need to explicitly specify the discriminator in the Query. However, it should probably be automatic so I'll try and add it as a feature into the next release. Cheers, Andrew.
|
|