I have a class with a number of fields, one being an IList<KeyValuePair<string, string>>
.
public class Foo
{
public IList<KeyValuePair<string, string>> Bars { get; set; }
}
I'm using Fluent NHibernate and that particular field is mapped as follows:
HasMany(x => x.Bars).Component(Bar.Map);
and
public class BarMap : ComponentMap<KeyValuePair<string, string>>
{
public BarMap()
{
Map(x => x.Key);
Map(x => x.Value);
}
public static void Map(CompositeElementPart<KeyValuePair<string, string>> part)
{
part.Map(x => x.Key);
part.Map(x => x.Value);
}
}
Using the ICriteria API, I would like to be able to select all Foo where Bars contains a key value pair { X, Y }
, and for the matching of X and Y values to be case insensitive. How can I do this?