Linq distinct record containing keywords

前端 未结 12 2096
醉话见心
醉话见心 2021-02-19 05:09

I need to return a distinct list of records based on a car keywords search like: \"Alfa 147\"

The problem is that, as I have 3 \"Alfa\" cars, it returns 1 + 3 records (i

12条回答
  •  终归单人心
    2021-02-19 05:50

    You can use the Distinct() method.

    var query = ...
    var query = query.Distinct();
    

    See This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type for more details.

提交回复
热议问题