Fixed casting of discriminatorKey defined Models

Fixes casting of Model object types by discriminatorKey