locked
Problem with EF6 DynamicData RRS feed

  • Question

  • I converted EF5 DD project with your guide, but it doesn't work

    http://blogs.msdn.com/b/webdev/archive/2014/01/30/announcing-preview-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx?PageIndex=2#comments

    Then i Put

     DefaultModel.RegisterContext(
                new Microsoft.AspNet.DynamicData.ModelProviders.EFDataModelProvider(() =>
                    RendicontazioneEntities()),
                    newContextConfiguration { ScaffoldAllTables = true });

    I received this errors
    Error 8 'RendicontazioneEntities' is a 'type' but is used like a 'variable' 

    Before i Used
     DefaultModel.RegisterContext(() =>
            {
                return ((System.Data.Entity.Infrastructure.IObjectContextAdapter)new RendicontazioneEntities()).ObjectContext;
            }, new ContextConfiguration() { ScaffoldAllTables = true });

    Can you help me please? thanks


    matteo ghetti

    • Moved by Fred Bao Thursday, April 3, 2014 7:53 AM EF Related
    Wednesday, April 2, 2014 10:46 AM

Answers

  • Hello,

    >>Error 8 'RendicontazioneEntities' is a 'type' but is used like a 'variable'

    The “new” should be a key work to initialize an instance of a type, have a try with below:

    DefaultModel.RegisterContext(
    
                 new Microsoft.AspNet.DynamicData.ModelProviders.EFDataModelProvider(() => 
    
                     new RendicontazioneEntities()),
    
                     new ContextConfiguration { ScaffoldAllTables = true });
    

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, April 16, 2014 5:27 AM
    Thursday, April 3, 2014 7:59 AM

All replies

  • Hello,

    >>Error 8 'RendicontazioneEntities' is a 'type' but is used like a 'variable'

    The “new” should be a key work to initialize an instance of a type, have a try with below:

    DefaultModel.RegisterContext(
    
                 new Microsoft.AspNet.DynamicData.ModelProviders.EFDataModelProvider(() => 
    
                     new RendicontazioneEntities()),
    
                     new ContextConfiguration { ScaffoldAllTables = true });
    

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, April 16, 2014 5:27 AM
    Thursday, April 3, 2014 7:59 AM
  • It works. And everythink works without problem also with Dynamic Data Web Site, not only with Dynamic data Web project!

    thanks


    matteo ghetti

    Wednesday, April 16, 2014 7:13 AM