Open
Description
When SqlTopicRepository,Load()
can't find a Topic
, it throws a TopicNotFoundException
. When CachedTopicRepository.Load()
can't find a topic, it returns null
. In fact, the signature for Load()
on SqlTopicRepository
returns a Topic
, whereas the signature for Load()
on CachedTopicRepository
(and, incidentally, ITopicRepository
) returns a Topic?
.
There are good arguments for returning null
vs. throwing an exception here. But the behavior and the return type nullability should be consistent—or, at least, clearly documented. That said, updating this behavior is a breaking change, and so this may need to wait until OnTopic 6.0.0.