I have the following class structures :
public class QuoteRequestInfo
{
. . .
public LocationInfo LocationInfo {get;set;}
. . .
}
LocationInfo has a stop collection which will always contain 2 stops :
public class LocationInfo
{
. . .
public IEnumerable<Stop> Stops{get;set};
. . .
}
Stop has the following property :
public class Stop
{
. . .
public string StateName {get;set};
. . .
}
I am trying to search QuoteRquestInfos collection by filtering on multiple state names like so :
var states = new List<string> {"VA"}
var filter = Builders<QuoteRequestInfo>.Filter.In(r => r.LocationInfo.Stops.First().StateCode, states)
var quotes = await collection.Find(filter).ToListAsync();
This is returning an empty filter and not matching anything? how should I be passing in the expression to the In Filter ? any ideas ?