Design Code for Change | Empty of T, please! | Extension Method as a Workaround

Опубликовано: 06 Октябрь 2024
на канале: Code with Saar
75
3

Thumb of rule: Whenever it fits, return Enumerable of T instead of null. And an extension method, if you can't.

00:00 Introduction: Empty of T
01:01 Example Code without using Empty of T
01:25 Point out the issue of null handling
02:33 Reproduce the issue
03:25 Not so good a fix
04:00 Fix the issue with Empty of T!
05:00 Work around for code that you don't own that is not using Empty of T
06:29 Recap