EF generating wasted db calls
Odd one this! Caused by a fairly innocuous looking
var result = MyRepository.Select(a => myIds.Contains(a.theirID)).ToList();
It was a two fold effect, datetime2 was being CAST(NULL AS datetime2) AS in the generated SQL therefore at the point where it was being mapped back to entity it was failing a unknown type. The root of the cause was in the blog post. Read it for a nice detailed run at the issue, thanks to the OP