fixed entity framework tests
fixed bugs with entity query