System.Ling
It seems to me that apart from test nothing else is needed for complete understanding.
tests: https://github.com/dotnet/runtime/tree/main/src/libraries/System.Linq/tests
The query should be executed in the database; this is more efficient to use compiled query: stored procedure. If there is no access to the server then you have to manipulate the data on the client.
- additional: https://github.com/dotnet/try-samples/tree/main/101-linq-samples/src
- full methods list:
- Enumerable.cs
- Queryable.cs
Selection
Where.csafter ‘group by’ implements ‘having’Take.csSkip.csSkipWhileTakeWhile
Uniq selection
Distinct.cscheck through adding to Hashset
Selection of a single item
First.csFirstDefaultLastLastDefaultElementAt.csis not supported in LINQ to SQLSingle.csthrow error if selection have several convinient recordsSingleDefaultDefaultIfEmptyreturns null or default(TSource) if the sequence has no elements
Aggregation, calculation
Average.csCount.csLongCountMax.csMin.csSum.csMaxByjust for IEnumerableMinByjust for IEnumerable
Sorting
OrderByThenBysort records with same key after previous sortingOrderByDescendingThenByDescendingReverse
Transformation
Aggregate.csIEnumarableSelect.csoption with index (m,i)IEnumarable<T>T another type of itemsCastthrow errorofTypepass error during transformationSelectMany.csone-to-many data is taken from the second table and transferred to the response
Qualifiers
Contains.csinterchangable withAnyAnyinterchangable withConainsAll.cs
Interfaces
Asenumerabledoesn’t force immediate query executionAsQueryable
Grouping
Grouping.csGroupJoin.cs
Collection manipulation
Join.csLeftJoin with assistent DefaultIfEmpty()Concat.csfor first sequence come next oneUnion.csuniqUnionByIntersect.csuniq intersectionExcept.csuniq diffrence not exist, not inChunk.cs[][]Zip.csarray of anonyme types
Compare
SequenceEqual.cs
Add
AppendPrepend.cs
Change a collection type
ToArrayToDictionaryToCollection.csToListToLookUpgrouping records by arbitrary field of tableToHashSet
Generation
Range.csonly for int. Static EnumerableRepeat.csonly for intEmpty
This post is licensed under CC BY 4.0 by the author.