Hi.
Is it possible to create a view similar to a defining query for an edml model (model first)?
I solved my issue here (http://forums.devart.com/posting.php?f=1&t=30948) by using a defining query and thus switching to pure model-first.
The defining query get's executed everytime I access the corresponding DBSet, which is basically the same as when using SQL Views.
In future it may be required to replace those views by materialized views, thus they have to be defined in the database.
Is that possible? If it is: How to do it?
I would like to avoid the Database First Approach now as the Model First Approach basically seems to work with the DevArt Provider without hacks.
regards
Peter
Define a Database View from DotConnect
Re: Define a Database View from DotConnect
The View Generation option of the model with Entity Framework version = Entity Framework 6 is supported for the DbContext (only with XML mapping), EntityObject, POCO, and Self-Tracking Entities templates. Just set View Generation to True and save the model.jongleur wrote:In future it may be required to replace those views by materialized views, thus they have to be defined in the database.
Is that possible? If it is: How to do it?
Re: Define a Database View from DotConnect
Reading what I have:
- Properties of the Model Explorers root node (Model, right click/Properties): View Generation = true, Lazy Loading Enabled = True
- "Model Settings" of that root node (right click/Model Settings), General: "View Generation" is checked, Entity Framework Version is "Entity Framework 6"
- Template used (only that one): DbContext. Adjusted Settings: Proxy Creation Enabled = False, thus (double checked) it should use XML Mapping
You say, View Generation Option is supported for
- EF 6 (check)
- for the DbContext (check)
- with XML mapping (check)
when I
- set View Generation to True and save the model (check)
but there is no view generated.
Thanks nevertheless and happy Christmas
Peter
- Properties of the Model Explorers root node (Model, right click/Properties): View Generation = true, Lazy Loading Enabled = True
- "Model Settings" of that root node (right click/Model Settings), General: "View Generation" is checked, Entity Framework Version is "Entity Framework 6"
- Template used (only that one): DbContext. Adjusted Settings: Proxy Creation Enabled = False, thus (double checked) it should use XML Mapping
You say, View Generation Option is supported for
- EF 6 (check)
- for the DbContext (check)
- with XML mapping (check)
when I
- set View Generation to True and save the model (check)
but there is no view generated.
Thanks nevertheless and happy Christmas
Peter
Re: Define a Database View from DotConnect
Further investigations of the issue:
- Defining the view (as "defining query") I get a correct preview result on "execute".
- "Select Data" on the Class in the model Returns a wrong result.
If I reproduce the wrapped query (which is basically SELECT * FROM ([DEFINING QUERY]) "Extent1", where * is replaced by all fields of the defining query result, and try to execute that query myself, I get an error on the field that is wrong when fetched using the model Editor.
Nevertheless: the view still isn't generated at all, the query is stored in the model and is still executed each time the DbSet is accessed via Code.
- Defining the view (as "defining query") I get a correct preview result on "execute".
- "Select Data" on the Class in the model Returns a wrong result.
If I reproduce the wrapped query (which is basically SELECT * FROM ([DEFINING QUERY]) "Extent1", where * is replaced by all fields of the defining query result, and try to execute that query myself, I get an error on the field that is wrong when fetched using the model Editor.
Nevertheless: the view still isn't generated at all, the query is stored in the model and is still executed each time the DbSet is accessed via Code.
Re: Define a Database View from DotConnect
Setting store:Type to "Views" manually does not help either.
Re: Define a Database View from DotConnect
Looks like I misunderstood your first message in this thread.
You want Entity Developer to generate a materialized view in a database basing on a defining query in the model, don't you? Please submit your request at http://devart.uservoice.com/forums/3867 ... -developer.jongleur wrote:Is it possible to create a view similar to a defining query for an edml model (model first)?
I solved my issue here (http://forums.devart.com/posting.php?f=1&t=30948) by using a defining query and thus switching to pure model-first.
The defining query get's executed everytime I access the corresponding DBSet, which is basically the same as when using SQL Views.
In future it may be required to replace those views by materialized views, thus they have to be defined in the database.
Re: Define a Database View from DotConnect
Thanks for you help again, happy new year, and idea suggested here:
http://devart.uservoice.com/forums/3867 ... eveloper-m
regards
Peter
http://devart.uservoice.com/forums/3867 ... eveloper-m
regards
Peter