Guides writing C# LINQ queries with deferred execution awareness, database translation respect, and pragmatic loop usage. Use when querying collections or ORMs, or debugging surprising LINQ behavior.
LINQ is two different tools sharing one syntax: in-memory sequence pipelines (LINQ-to-Objects) and expression trees translated to SQL (EF-style providers). Most LINQ bugs come from forgetting which one you are holding.
IEnumerable returned up the stack
may execute long after its data source changed. Materialize
deliberately with ToList()/ToArray() exactly once at the
boundary where results are needed (see caching-strategy's
cache-boundary instinct, applied in-process).IQueryable,
only what the provider can turn into SQL belongs: no local method
calls, no custom property logic. Filter, project
(Select into a DTO with just the needed columns), sort, and
page in the database; switch to objects explicitly
(AsEnumerable()) only when server-side work is done. The
classic failure is a filter that silently runs client-side after
fetching the table (see n-plus-one-queries,
pagination-performance).Any over
Count() > 0; FirstOrDefault with a predicate over
Where(...).FirstOrDefault(); ToDictionary/ToLookup to
replace nested Where scans (turning O(n*m) joins into O(n+m):
see algorithmic-optimization); GroupBy and Join knowingly, as
they buffer. Know the buffering operators (OrderBy, GroupBy,
Reverse) versus streaming ones (Where, Select, Take) when
pipelines process large sequences.foreach
beats a clever aggregate; LINQ is for making intent more
readable, not for code golf (see cognitive-load).if (x != null) query = query.Where(...)): the
provider composes one SQL statement, and the pattern replaces
dynamic SQL assembly (see sql-injection-defense). Extract
reusable filters as IQueryable extension methods so the same
predicate is not re-invented per call site.ToListAsync, await foreach) belongs to the
provider/stream boundary (see dotnet-async); mixing sync
materialization into async request paths blocks threads.What SKILL.md sets; muted values are Claude Code's defaults
Not loaded · from ai-skills-commands
Claude Code won't load this skill
It ships in ai-skills-commands at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
npx claudepluginhub amey-thakur/ai-skills --plugin ai-skills-commands1,000 skills in this plugin
/ab-test-designDesign product experiments with real hypotheses, honest sample-size math, guardrails, and peeking discipline. Use when validating a change by experiment or reviewing a test before believing its result./accessibility-reviewAudit a UI for real accessibility, keyboard-first, with concrete failures and fixes rather than checkbox compliance. Use when reviewing or building any user interface./accessibility-specialist-roleOperate as an accessibility specialist who audits against WCAG, trains teams to stop shipping the same defects, and owns the compliance sign-off. Use when a product needs to be usable with a keyboard, a screen reader, or magnification and someone must certify it before launch.Other plugins' skills for the same job