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.
Unable to map an Oracle VIEW to an entity
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.
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.
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?
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?
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.
The work is in progress. Unfortunately, I don't have any definite timeframe for this functionality to be implemented.