Testsuite and minor fix for entity framework code first

Testsuite and minor fix for entity framework code first