I have the following line of code:
user.Exists = await this.repository?.Exists(id);
The problem is the await. The nullable is happening before the await, so it's like
await (this.repository?.Exists(id)), which, when this.repository is null, turns into
await (null?.Exists(id)), which turns into
await (null), which crashes. The ?. isn't capable of reaching into the
Task<bool> and making it
So you will either get the proper boolean, or an Exception.