diff --git a/samples/Console/Program.cs b/samples/Console/Program.cs new file mode 100644 index 0000000..c4352aa --- /dev/null +++ b/samples/Console/Program.cs @@ -0,0 +1,26 @@ +using Danom; + +public static class OptionSamples +{ + private static readonly IEnumerable _store = Enumerable.Range(1, 100); + + public static Option TryFindInt(Func predicate) => + _store.FirstOrDefault(predicate).ToOption(); + + public static void Test() + { + if (Option.Some(1).DefaultValue(1) == 1) + { + Console.WriteLine("Some"); + } + } +} + +// write main method +public static class Program +{ + public static void Main() + { + OptionSamples.Test(); + } +}