Answers for "how to select distinct with linq"

SQL
14

select count of distinct values sql

SELECT COUNT (DISTINCT column-name)  FROM table-name
Posted by: Guest on March-06-2020
0

select distinct linq mvc

public static IQueryable<ProdType> GetDistinctProdType(
    this IQueryable<ProdInfo> query,
    int categoryId)
{
    return (from p in query
            where p.CatID == categoryId
            select p.Type).Distinct();
}
Posted by: Guest on March-05-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language