How can I add groupby Id to this nhibernate code because I'm new with it and there is many way but none work for me.
.Select(Projections.Sum(() => ServiceOrderItem.WorkTime), 
    Projections.ProjectionList().Add(Projections.Property(
        () => ServiceOrder.Id).WithAlias(() => TechnicianWorkTime.Id))
    )
There will be more in ProjectionList...
You can use SelectList for it:
query.SelectList(list => list
  .SelectGroup(() => ServiceOrder.Id)
  .SelectSum(() => ServiceOrderItem.WorkTime));
                        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