Try this:
table1.GroupBy(x => x.Text).Select(x => x.FirstOrDefault());
This will group the table by Text
and use the first row from each groups resulting in rows where Text
is distinct.
More Related Contents:
- convert sql query into lambda expression [closed]
- LINQ to Entities does not recognize the method ‘System.String ToString()’ method, and this method cannot be translated into a store expression
- Is there a good LINQ way to do a cartesian product?
- LINQ to SQL – Left Outer Join with multiple join conditions
- linq case statement
- LINQ to SQL multiple tables left outer join
- Equivalent of SQL ISNULL in LINQ?
- Could not find an implementation of the query pattern
- Wildcard search for LINQ
- Get an IDataReader from a typed List
- Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator
- Entity Framework. Delete all rows in table
- Use linq to generate direct update without select
- Join and Include in Entity Framework
- How to make LINQ execute a (SQL) LIKE range search
- Calling a SQL User-defined function in a LINQ query
- Issues Doing a String Comparison in LINQ
- Convert SQL to LINQ Query [closed]
- Linq To Sql compare Time only
- Linq union usage?
- Distinct by property of class with LINQ [duplicate]
- How to Bulk Update records in Entity Framework?
- Linq order by, group by and order by each group?
- Find character with most occurrences in string?
- SQL update statement in C#
- Checking for empty or null JToken in a JObject
- SQL/C# – Best method for executing a query
- Index (zero based) must be greater than or equal to zero
- Select all columns after JOIN in LINQ
- Linq – Top value from each group