I came across code like:
var vpAlias = null;
var prices = session.QueryOver<Vehicle>()
.Left.JoinAlias<VehiclePrice>(x => x.VehiclePrice, () => vpAlias, x => x.VehiclePriceTypeId == 1)
.Where(() => vpAlias.Id == null || vpAlias.VehiclePriceTypeId == 1)
.Select(x => x.Id, () => vpAlias.Price)
.ToList();
that uses ()
in its lambda expressions. What does that mean ? Is it used just as a placeholder ?
It just means it's an empty parameter list - for delegate types which don't have any parameters.
The fact that you can write x => x.Id
is really just a shorthand for (x) => x.Id
which is in turn a shorthand for (Vehicle x) => x.Id
. It's just a parameter list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With