AgentMarketMCP / SKILL 资产档案馆

目录 / C#

SKILL 未评级 已上架

C#

--- name: C# slug: csharp version: 1.0.1 description: Write robust C# avoiding null traps, async deadlocks, and LINQ pitfalls. metadata: {"clawdbot":{"emoji":"💜","requires":{"bins":["dotnet"]},"os":["linux","darwin","win32"]}} --- ## Quick Reference | Topic | File | |-------|------| | Null reference, nullable types | `nulls.md` | | Async/await, deadlocks | `async.md` | | Deferred execution, closures | `linq.md` | | Value vs reference, boxing | `types.md` | | Iteration, equality | `collections.md` | | IDisposable, using, finalizers | `dispose.md` | ## Critical Rules - `?.` and `??` prevent NRE but `!` overrides warnings — still crashes if null - `.Result` or `.Wait()` on UI thread — deadlock, use `await` or `ConfigureAwait(false)` - LINQ is lazy — `query.Where(...)` doesn't execute until iteration - Multiple enumeration of IEnumerable — may re-query database, call `.ToList()` first - Closure captures variable, not value — loop variable in lambda captures last value - Struct in async method — copied, modifications lost after await - String comparison culture — `StringComparison.Ordinal` for code, `CurrentCulture` for UI - `GetHashCode()` must be stable — mutable fields break dictionary lookup - Modifying collection while iterating — throws, use `.ToList()` to iterate copy - `decimal` for money — `float`/`double` have precision loss - `readonly struct` prevents defensive copies — use for performance - `sealed` prevents inheritance — enables devirtualization optimization

模型生成摘要(rules/v1 · 2026-10-01 11:05):---
这是模型对公开材料的总结,不是官方声明,请以原链内容为准。

存档时间线

版本存档时间内容哈希内容
v52026-09-28 17:5259f00acd 已过保留期
v62026-09-29 02:3230cf4b19 已过保留期
v72026-09-28 21:2859f00acd 已过保留期
v82026-09-29 12:0730cf4b19 已过保留期
v92026-09-29 16:2259f00acd 已过保留期
v102026-09-30 04:1130cf4b19 已过保留期
v112026-09-30 11:2759f00acd 已过保留期
v122026-09-30 23:3430cf4b19 已过保留期
v132026-10-01 06:3259f00acd 已过保留期
v142026-10-01 18:1530cf4b19 可取

版本索引永久保留;内容副本只保留最新 1 份,更早版本仅留索引与哈希(存档时间线的证据链不会因此断裂)。

下载存档内容副本

纠错与举报(发现条目失效、署名有误或涉及侵权?)
提交举报 / 纠错

侵权举报经核验成立后,我们会即时下线该条目并删除已存的内容副本。