Fixed collection type reflection issues

When you add a new type to the InMemoryDataContext it will try to create a repository through reflection. It will fail with relationships that are collections when attempting to find all the singular relationships. The fixing code was pulled from v5.0.6.0