Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to declare an Optional type in C#? [duplicate]

Tags:

c#

.net

generics

Java 8 has Optional<T> which is nice way to declare optional types as described here. Is there an equivalent way to that in C# ?

like image 867
AymenDaoudi Avatar asked Jun 15 '14 17:06

AymenDaoudi


1 Answers

As per this answer You could make a struct that mimics this this type of functionality.

like image 190
Kracobsen Avatar answered Oct 28 '22 08:10

Kracobsen