[CSHARP-65] LINQ Query returns non empty result collection when it shouldn't Created: 14/Sep/10  Updated: 19/Oct/16  Resolved: 29/Oct/10

Status: Closed
Project: C# Driver
Component/s: SAMUS
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Oliver Weichhold Assignee: Sam Corder
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Given the following entity and an empty collection in the database:

public class Post
{
[MongoId]
public Guid Id

{ get; set; }

public DateTime LastAccess { get; set; }

public List<string> Tags

{ get; set; }

}

The following query should return an empty list but it returns a list containing a single empty Post entity:

List<string> SearchTags = new List<string>

{"test"}

;

var result = SearchTags.Aggregate(posts.Linq(), (current, tag) => current.Where(x => x.Tags.Any(t => t == tag))).OrderByDescending(
x => x.LastAccess).Skip(skip).Take(take).ToList();



 Comments   
Comment by Steve Wagner [ 29/Oct/10 ]

Migrated to http://github.com/mongodb-csharp/mongodb-csharp/issues/issue/19

Generated at Wed Feb 07 21:35:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.