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'm getting this error back when doing a projection: Value cannot be null. My code looks like this: public static IEnumerable<int> GetPickedDraws(Game game, User user){ Query query = new Query(Attribute("GameId") == game.Id &&Attribute( "UserId") == user.Id);query.Projection.Add("Draw");query.Order = Order.By("Draw").Descending();using (IDataReader reader = UOW.Project(query)){ while (reader.NextResult()){ yield return (int)reader["Draw"];} reader.Dispose(); } } Any reason why I am getting that error? It fails on the UOW.Project(query) call. Thanks, Craig |
|
|
I think the problem is you're not telling it what kind of entity to project from -- i.e. what table does the "Draw" attribute in the projection refer to. Set query.EntityType to the entity corresponding to the table you want to query (i.e. the entity which would have the Draw property if you selecting a whole entity rather than projecting). |
|
|
Aha, thanks. I was going of the documentation for projection and it didn't say that in there but it makes sense now that you've said it. Cheers, Craig |
|