Quantcast
Channel: Code monkey CODE!!
Viewing all articles
Browse latest Browse all 10

Type datetime2 is not a defined system type

$
0
0

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 :)


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images