locked
Any REAL support for database views in 2012 Update 2, please? RRS feed

  • Question

  • An inherited name-value pair table has a view over it to present the name portion more intelligibly.  The view is the data "table" I need to use.  In LS1 Views were treated horrendously.

    Appears they still are in the latest Update... "The key has been inferred and the definition was created as a read-only table/view"

    Are there ANY plans to support read-write through Views that are backed by an INSTEAD OF trigger, please?  This is a SQL 2012 back end and it should really be possible by now for LightSwitch/Entity Framework to understand database constructs that have existed since 2000...

    The lack of this feature SEVERELY constrains the usefulness of LightSwitch when it comes to filtered datasets via views - a common practice and a very efficient one, too.

    Workarounds, anyone?

    Saturday, April 6, 2013 12:51 AM

Answers

  • I agree with Xander, & this is the method that I use myself, to "tame" some legacy tables that I have to deal with. I also like that I have "full control" over the data, as Xander said.

    If you think that a RIA Service is "too much hassle", it's really not, & once you start using them in this way, they're a HUGE blessing.

    The way that views are handled (inferring the key etc) is governed by Entity Framework, not LightSwitch. If EF doesn't change how it works with views, then there's nothing that LightSwitch can do about it.


    Yann - LightSwitch Central
    Luminous Tools for LightSwitch (a FREE productivity extension)
    FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer", if any reply answers your question.
    Please click "Vote as Helpful", if you find any reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Angie Xu Wednesday, April 24, 2013 7:53 AM
    Monday, April 8, 2013 2:06 AM
    Moderator
  • I do not believe anything has changed with regards to views as you've already discovered. One work around would be to create a RIA domain service and expose those views as entity models though the service. This is quite easy and gives you full control. Regards

    Xander

    • Proposed as answer by babloo1436 Saturday, April 6, 2013 4:10 PM
    • Marked as answer by Angie Xu Wednesday, April 24, 2013 7:53 AM
    Saturday, April 6, 2013 4:59 AM

All replies

  • I do not believe anything has changed with regards to views as you've already discovered. One work around would be to create a RIA domain service and expose those views as entity models though the service. This is quite easy and gives you full control. Regards

    Xander

    • Proposed as answer by babloo1436 Saturday, April 6, 2013 4:10 PM
    • Marked as answer by Angie Xu Wednesday, April 24, 2013 7:53 AM
    Saturday, April 6, 2013 4:59 AM
  • I agree with Xander, & this is the method that I use myself, to "tame" some legacy tables that I have to deal with. I also like that I have "full control" over the data, as Xander said.

    If you think that a RIA Service is "too much hassle", it's really not, & once you start using them in this way, they're a HUGE blessing.

    The way that views are handled (inferring the key etc) is governed by Entity Framework, not LightSwitch. If EF doesn't change how it works with views, then there's nothing that LightSwitch can do about it.


    Yann - LightSwitch Central
    Luminous Tools for LightSwitch (a FREE productivity extension)
    FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer", if any reply answers your question.
    Please click "Vote as Helpful", if you find any reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Marked as answer by Angie Xu Wednesday, April 24, 2013 7:53 AM
    Monday, April 8, 2013 2:06 AM
    Moderator