See Build Your Own Option Type in C# and Use It Like a Pro: https://www.youtube.com/watch?v=gpOQl2q0PTU
In this video, you will learn how to design a powerful and flexible implementation of the Option type, and then use it to build equally powerful domain models. It is not necessary to use third-party libraries that include Option implementation. It is not the Option type a programmer needs - such a type can be coded in minutes. What programmers truly need is the backing knowledge of how and when to use optional objects.
This video combines the two questions: defining the Option type and designing a domain model that incorporates it, into one unified demonstration. You will learn how Optional objects can be used to bridge the gap between potentially missing objects at run time, and functions that always require an object to produce a result. It is that powerful Map-Reduce combination that will make your domain models expressive on the one hand, but also extensible and composable on the other. What else could one wish for?
The complete source code from this demonstration is available in GitHub repository: https://github.com/zoran-horvat/optional