var person = People.SingleOrDefault(p => p.Name == parameter);
SelectedPerson = person ?? DefaultPerson
Could this be written in one statement?
Measing can I provide the default element that SingleOrDefault returns?
I am looking for someting like this (the second argument is the default element I provide).
var person = People.SingleOrDefault(p => p.Name == parameter, DefaultPerson);
The solution should also work for value types (ints, doubles, enums, structs, ...).
SelectedPerson = People.SingleOrDefault(p => p.Name == parameter)??DefaultPerson? it should work.ints?