Applying a filter in a Fluent NHibernate mapping using a lambda referencing an inherited property?
问题 Is there any way to specify in a fluent nhibernate mapping file a way to only conditionally pull values into a business entity? My current mapping snippet is: HasMany(m => m.GroupUsers) .Table("GroupUsers") .KeyColumns.Add("UserEntityId") .Inverse() .Cascade.All(); Ideally, I'd like to have this (which compiles but throws a runtime error that gu isn't defined): HasMany(m => m.GroupUsers) .Table("GroupUsers") .KeyColumns.Add("UserEntityId") .Where(gu => gu.DeleteDate == null) .Inverse()