Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-2722

Linq Count() does not respect previous calls to Select() or Distinct()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects versions: 3.1.0
    • Fix versions: 3.3.0.CR1
    • Components: Linq Provider
    • Labels:
      None
    • Sprint:

      Description

      session.Query<DomainEntity>()
      .Select(x => x.Property)
      .Distinct()
      .Count()

      Results in a count query being executed, rather than a count(distinct Property) query.

      session.Query<DomainEntity>()
      .Select(x => x.Property)
      .Count()

      Results in a count query, rather than a count(Property) query.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chrisblock Chris Block
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Who's Looking?