Bug #67423 Mapping a view with UNION ALL to EF 5 edmx
Submitted: 30 Oct 2012 14:41 Modified: 8 Dec 2012 12:50
Reporter: Bogdan Fürst Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.6.4rc OS:Windows (win7)
Assigned to: Assigned Account CPU Architecture:Any
Tags: edmx, Entity Framework 5, model, UNION ALL, VIEW

[30 Oct 2012 14:41] Bogdan Fürst
Description:
In Visual Studio 2012 debug, all items selected from a view with UNION ALL, are the same, even though mysql query works correctly in Workbench.

How to repeat:
Create a view with Workbench 5.5.44;
Add three select statements that select 4 columns (aliased with AS), merged with two UNION ALL commands;
Save and Sync model;
In Visual Stuido 2012, update edmx model from database;
Run app and perform select on this view -> all items are the same, even though mysql query works correctly in Workbench

Suggested fix:
Workaround: in edmx designer, for all columns of such view, set EntityKey to true. Seems to fix the problem.
[8 Nov 2012 12:50] Gabriela Martinez Sanchez
hi Bodgan,

Thanks for your bug report. I tried to reproduce it with 3 tables using the Sakila  sample db and I received the results correctly. Could please give us more information about the structure you have in your three tables where this problem occurs? Thank you in advance.
[9 Dec 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".