Code Cleanup: Removing unnecessary usage of IConfiguration
Added constraints and checks to ensure CLR entity types are reference types.
Fixup - changes based on PR comments.