public async Task LinqMethodWorksForExplicitUserTypeAsync() { using (var session = OpenSession()) using (session.BeginTransaction()) { var newItem = new BarExample { Value = "Larry" }; var entities = await(session.Query <EntityWithUserTypeProperty>() .Where(x => x.Example.IsEquivalentTo(newItem.MappedAs(NHibernateUtil.Custom(typeof(ExampleUserType))))) .ToListAsync()); Assert.AreEqual(2, entities.Count); } }
public void EqualityWorksForExplicitUserType() { using (var session = OpenSession()) using (session.BeginTransaction()) { var newItem = new BarExample { Value = "Larry" }; var entities = session.Query <EntityWithUserTypeProperty>() .Where(x => x.Example == newItem.MappedAs(NHibernateUtil.Custom(typeof(ExampleUserType)))) .ToList(); Assert.AreEqual(1, entities.Count); } }