实例介绍
【实例截图】
【核心代码】
Contents
Introduction
Chapter 1 C# Language Idioms
Item 1: Prefer Implicitly Typed Local Variables Item 2: Prefer readonly to const
Item 3: Prefer the is or as Operators to Casts
Item 4: Replace string.Format() with Interpolated Strings Item 5: Prefer FormattableString for Culture-Specific Strings Item 6: Avoid String-ly Typed APIs
Item 7: Express Callbacks with Delegates
Item 8: Use the Null Conditional Operator for Event Invocations Item 9: Minimize Boxing and Unboxing
Item 10: Use the new Modifier Only to React to Base Class Updates
Chapter 2 .NET Resource Management
Item 11: Understand .NET Resource Management
Item 12: Prefer Member Initializers to Assignment Statements Item 13: Use Proper Initialization for Static Class Members Item 14: Minimize Duplicate Initialization Logic
Item 15: Avoid Creating Unnecessary Objects
Item 16: Never Call Virtual Functions in Constructors
Item 17: Implement the Standard Dispose Pattern
Chapter 3 Working with Generics
Item 18: Always Define Constraints That Are Minimal and Sufficient
Item 19: Specialize Generic Algorithms Using Runtime Type Checking
Item 20: Implement Ordering Relations with IComparable<T> and IComparer<T> Item 21: Always Create Generic Classes That Support Disposable Type Parameters Item 22: Support Generic Covariance and Contravariance
Item 23: Use Delegates to Define Method Constraints on Type Parameters
Item 24: Do Not Create Generic Specialization on Base Classes or Interfaces
Item 25: Prefer Generic Methods Unless Type Parameters Are Instance Fields
Item 26: Implement Classic Interfaces in Addition to Generic Interfaces
Item 27: Augment Minimal Interface Contracts with Extension Methods
Item 28: Consider Enhancing Constructed Types with Extension Methods
Chapter 4 Working with LINQ
Item 29: Prefer Iterator Methods to Returning Collections
Item 30: Prefer Query Syntax to Loops
Item 31: Create Composable APIs for Sequences
Item 32: Decouple Iterations from Actions, Predicates, and Functions Item 33: Generate Sequence Items as Requested
Item 34: Loosen Coupling by Using Function Parameters
Item 35: Never Overload Extension Methods
Item 36: Understand How Query Expressions Map to Method Calls
Item 37: Prefer Lazy Evaluation to Eager Evaluation in Queries
Item 38: Prefer Lambda Expressions to Methods
Item 39: Avoid Throwing Exceptions in Functions and Actions
Item 40: Distinguish Early from Deferred Execution
Item 41: Avoid Capturing Expensive Resources
Item 42: Distinguish between IEnumerable and IQueryable Data Sources
Item 43: Use Single() and First() to Enforce Semantic Expectations on Queries Item 44: Avoid Modifying Bound Variables 215
Chapter 5 Exception Practices
Item 45: Use Exceptions to Report Method Contract Failures
Item 46: Utilize using and try/finally for Resource Cleanup
Item 47: Create Complete Application-Specific Exception Classes Item 48: Prefer the Strong Exception Guarantee
Item 49: Prefer Exception Filters to catch and re-throw
Item 50: Leverage Side Effects in Exception Filters
Index
相关软件
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论