2

I'm trying to execute this SQL query inside lightswitch:

Select distinct [columnName] from [table]

The query window only has Filter, Sort, and Parameters

I have arrived on the DataService.cs file where I can manualy edit the queries, but im stuck here:

    partial void QueryName_PreprocessQuery(ref IQueryable<ServiceUser> query)
    {
        query = query.Distinct();
    }

This selects the whole table. I want the distinct values of only one column. Note that I can add a view to the database and update it as an entity but thats not what I'm looking for..

TsSkTo
  • 1,412
  • 13
  • 25
  • Why you don't try to use .GroupBy(i=> i.ColumnName)? http://stackoverflow.com/questions/1300088/distinct-with-lambda – abeppler Dec 17 '14 at 16:18

0 Answers0