EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Union All and returnmodel properties

Open tbjerknes opened this issue 9 years ago • 3 comments

When Union All is used in a query, the properties in the resulting return model are always of the nullable type. Here is a simple example i used:

image

Returnmodels for the two procs:

image

I am not sure this should be counted as an issue, but I just thought I would mention it.

tbjerknes avatar Aug 22 '16 11:08 tbjerknes

Thanks for the info. SQL Server tells me what the return columns are for each stored procedure. Not sure why it did that given the return columns are all NOT NULL. Very odd.

There is nothing I can do about it either as I have to accept the exact types returned to me. So I'll have to close this issue, but is an interesting facet of SQL Server.

sjh37 avatar Aug 22 '16 12:08 sjh37

Hi Simon, thanks for the reply. I did a bit of digging and from Sql Server 2012 you can use this query to get metadata:

image

this query correctly identifies both proc results as non-nullable

image

It doesnt't work for multiple query results though.

Thomas

tbjerknes avatar Aug 22 '16 14:08 tbjerknes

Thanks Thomas

sjh37 avatar Aug 22 '16 14:08 sjh37