EF5 and updateable views? RRS feed

  • Question

  • Hi,

    I have a few updateable views that I added as entities so that I can create associations. In EF4 I had to manually change the xml file so that such views are recognized as 'tables'. Has this problem been solved in EF5 or do I have to go through the same process?



    Marketplace: [url=http://tinyurl.com/75gc58b]Itza[/url] - Review: [url=http://tinyurl.com/ctdz422]Itza Update[/url]

    Tuesday, August 28, 2012 10:09 AM


  • Hi Cryo75,

    Yes, you also need to modify the metadata manually. Below is all the new features in EF5, please refer to them.

    EF 5 includes a number of new features and bug fixes to the EF4.3 release. Most of the new features are only available in applications targeting .NET 4.5, see the Compatibility section for more details.

    • Enum support allows you to have enum properties in your entity classes.
    • Spatial data types can now be exposed in your model using the DbGeography and DbGeometry types.
    • The Performance enhancements that we recently blogged about.
    • Code First will now detect if you have LocalDb or SQL Express available for creating new databases. Visual Studio 2012 includes LocalDb, whereas Visual Studio 2010 includes SQL Express.
    • Code First will add tables to existing database if the target database doesn’t contain any of the tables from the model.

    The EF Designer in Visual Studio 2012 also has some new features:

    • DbContext code generation for new models means that any new models created using the EF Designer will generate a derived DbContext and POCO classes by default. You can always revert to ObjectContext code generation if needed. Existing models will not automatically change to DbContext code generation.
    • Multiple-diagrams per model allows you to have several diagrams that visualize subsections of your overall model. Shapes on the design surface can also have coloring applied.
    • Table-Valued functions in an existing database can now be added to your model.
    • Batch import of stored procedures allows multiple stored procedures to be added to the model during model creation.

    Best Regards

    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    • Proposed as answer by Doraemon_3 Thursday, August 30, 2012 9:33 AM
    • Marked as answer by Allen_MSDN Monday, September 3, 2012 1:55 AM
    Wednesday, August 29, 2012 3:20 AM