Unable to map an Oracle VIEW to an entity

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
object
Posts: 91
Joined: Tue 26 Oct 2010 08:29

Unable to map an Oracle VIEW to an entity

Post by object » Mon 22 Nov 2010 20:29

Hello,

I tried to map a VIEW from an Oracle database to an EF entity, but designer compains that the view does not have a primary key. I added such key to a view definition, but still the same complain and the view is excluded from entity generation.

Do you know if there is a workaround for this?

Thanks in advance.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 23 Nov 2010 11:09

Add Devart Entity model to our project, iits functionality is the same as that of Microsoft ADO.NET Entity Data Model, but it has a more convenient designer (Devart Entity Developer, with VS integration).
There should not be any problems with the view in Devart Entity model.
As an alternative, you can add mappings for the view in the XML code of the .edmx model: uncomment the view in SSDL, add Nullable="false" to all columns you want to make key columns, create EntitySet for the view in SSDL, create a new entity in CSDL, and specify the mappings.
If your project requires an .edmx model only, you can copy XML corresponding to the particular view from the temporary .edml model.

object
Posts: 91
Joined: Tue 26 Oct 2010 08:29

Post by object » Wed 24 Nov 2010 09:38

Andrey,

Thanks for the advice. I managed, as you suggested to mamually add mappings to XML code but will consider now to user Devart Entity model if it's better in handling this.

One question about Devart Entity Developer. We are going to order a few licenses for our developers (my trial was successful and your support was just excellent), but we need to keep dual support for Oracle and SQL Server. After reading some threads here and other blog posts I managed to create a common CSDL file with separate MsSql and Oracle SSDL and mapping. It works fine now. If we buy dotConnect for Oracle and use Devart Entity developer, what would be the most efficient way of having dual support? I would like to mimimize manual work on extracting CSDLs, editing names in files etc. I realize I will have to keep some manual work, but from your experience is there any good practice to handle this?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 24 Nov 2010 15:15

We already have such a suggestion at Devart User Voice.
The work is in progress. Unfortunately, I don't have any definite timeframe for this functionality to be implemented.

Post Reply