Skip to content

Commit

Permalink
fixed JIRA:CSHARP-42 related to linq and an empty field selection lis…
Browse files Browse the repository at this point in the history
…t. Since it was a derived type, we were adding the discriminator which caused MongoDB to only bring back the discriminator.
  • Loading branch information
craiggwilson committed Jun 20, 2010
1 parent f531164 commit f911cc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/MongoDB/Linq/MongoQueryProvider.cs
Expand Up @@ -245,7 +245,8 @@ private object ExecuteFind(MongoQueryObject queryObject)
spec = queryObject.Query;

cursorType.GetMethod("Spec", new[] { typeof(Document) }).Invoke(cursor, new object[] { spec });
cursorType.GetMethod("Fields", new[] { typeof(Document) }).Invoke(cursor, new object[] { queryObject.Fields });
if(queryObject.Fields.Count > 0)
cursorType.GetMethod("Fields", new[] { typeof(Document) }).Invoke(cursor, new object[] { queryObject.Fields });
cursorType.GetMethod("Limit").Invoke(cursor, new object[] { queryObject.NumberToLimit });
cursorType.GetMethod("Skip").Invoke(cursor, new object[] { queryObject.NumberToSkip });

Expand Down

0 comments on commit f911cc7

Please sign in to comment.