Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 1.16 KB

README.md

File metadata and controls

62 lines (52 loc) · 1.16 KB

Linq Project

Uso de LinQ en C#

Operadores

Operador Where

librosCollection.Where(x => x.PageCount > 250 && x.Title.Contains("in Action"));

Operador All

librosCollection.All(x => x.Status != string.Empty);

Operador Any

librosCollection.Any(x => x.PublishedDate.Year == 2005);

Operador Contains

librosCollection.Where(x => x.Categories.Contains("Python"));

Operador LongCount

librosCollection.LongCount( l => l.PageCount >= 200 && l.PageCount <= 500 );

Operador Max

librosCollection.Max(x => x.PublishedDate);

Operador MinBy

book = librosCollection.MinBy(x => x.PageCount);

Operador Average

book = librosCollection.Average(x => x.PageCount);

Operador Agregate

book = librosCollection.Agregate(seed, (accumulator, next) => { Acumular(accumulator, next); return accumulator; } );

Operadores de agrupamiento

Operador GroupBy

book = librosCollection.GroupBy( p => p.PublishedDate.Year );

Operador ToLookup

book = librosCollection.ToLookup(p => p.Title[0], b => b);

Operador Join

book = coleccionA.Join( coleccionB, p => p.Id, q => q.otroId, (p, q) => p);