none
EF 4.1 queryview RRS feed

  • Question

  • Hi,

     

    I have successfully created a QueryView. However, whenever I choose 'generate database from model'

    1) a table is created for the entityset that the query view is mapped to.

    2) SSDL is generated and the queryview is replaced by a mapping to the generated table.

    How can I make it recognize that this is a queryview and it should not generate the SSDL?

    Wednesday, November 23, 2011 4:24 AM

Answers

  • Hi,

    The QueryView is a part of the SSDL specification.

    When you choose to create a database from the model it will always recreate the storage schema from your conceptual model to ensure that the model and the storage schema maps. There isn't any way to stop this, other than go away from model first.

    So, to be able to use QueryView you need to avoid creating database from model. There is unfortunatly no other choices.


    --Rune

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful" if the post helped you to a solution of your problem.
    Wednesday, November 23, 2011 5:33 PM

All replies

  • Hi,

    The QueryView is a part of the SSDL specification.

    When you choose to create a database from the model it will always recreate the storage schema from your conceptual model to ensure that the model and the storage schema maps. There isn't any way to stop this, other than go away from model first.

    So, to be able to use QueryView you need to avoid creating database from model. There is unfortunatly no other choices.


    --Rune

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful" if the post helped you to a solution of your problem.
    Wednesday, November 23, 2011 5:33 PM
  • I was afraid of that :( . Sure would be nice to be able to mark it in such a way that it is excluded from the database generation. The queryview should provide a clue that you don't need an actual table and that you already have defined the mapping yourself.
    Wednesday, November 23, 2011 6:46 PM