Created
February 12, 2018 14:04
-
-
Save jciechowski/6e39eb7715658bc9e9745a09c749967f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PizzaRepository() => _pizzas = new List<Pizza>() | |
public Maybe<Pizza> Get(int id) | |
{ | |
var pizza = _pizzas.FirstOrDefault(_ => _.Id == id); | |
return pizza == null ? Maybe.Empty<Pizza>() : pizza.ToMaybe(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment