Tweaked to handle EF in unit test but still using main DB instead of test.