locked
EntityViewContainer not being used RRS feed

  • Question

  • I have generated a class derived from EntityViewContainer using the T4 template from here:

    http://blogs.msdn.com/b/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx

    ( I have also tried generating it using EdmGen with the same result. )

     

    I have put a breakpoint on the GetViewAt() method and it is not hit. Also the time taken by the first query has not changed. This leads me to suspect that EF is not using my compiled view.

    Any ideas why this might happen?

     

    EF 4.0

    ASP.NET 4.0

    Model.edmx is in a DAL assembly, which also includes the Generated View class

    Self-tracking objects are in a different STO assembly

     

    Thanks,

    Nick

     

    Saturday, November 26, 2011 5:25 PM

Answers

  • Fixed it!

     

    The Generated View derived from EntityViewContainer must be in the assembly that contains the STOs Self-Tracking Objects.

     

    Nick

    Sunday, November 27, 2011 11:33 AM

All replies

  • Fixed it!

     

    The Generated View derived from EntityViewContainer must be in the assembly that contains the STOs Self-Tracking Objects.

     

    Nick

    Sunday, November 27, 2011 11:33 AM
  • Hi Nicholas,

    Thanks for sharing your experience here!

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, November 28, 2011 3:43 AM