Cannot generate POCOs from membership provider tables, puzzled?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Cannot generate POCOs from membership provider tables, puzzled?

Post by EdB » Tue 12 Mar 2013 01:20

Hi,

I can generate POCOs fine from my own dbo schema tables. However when I update my model with the membership tables like "aspnet_Membership", the model get updated with a new storage map including a class for "aspnet_Membership" - fine, but when I save the diagram no "aspnet_Membership" POCO class is generated. It is as if this table is different like in a different schema or has some property that prevents POCO generation.

Any thoughts? Can one not create POCOs from the membership provider tables?

Many Thanks in advance,

Ed

EDIT:

All I really wish to do is to read from these table, not update them as I understand the membership provider SPs etc may be recommended for this rather than EF directly.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by Shalex » Tue 12 Mar 2013 17:29

Please make sure that:
1) the aspnet_XXX classes are added to the conceptual part of the model
2) there are no model validation errors or/and code generation errors

If this doesn't help, send us a test model so that we can reproduce the problem in our environment. The aspnet_XXX classes are generated in the code in our tests.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by EdB » Tue 12 Mar 2013 21:06

Hi,

Thanks for this.

I have now sorted this.

I ended up using the standalone ED as I find the POCO generation more deliberate and dependable, unless I am missing something in the VS addin. At present I assume the only method to generate the POCOs in the addin is to save the model. There is no green "generate code" button.... or is there?

The issue was that the POCOs were being generated, but were not showing in VS2012 until I refreshed, and then they were not included in the project. After inclusion I could compile without an issue. Should the POCOs autorefresh and be included in the project by default?

Thanks.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by Shalex » Wed 13 Mar 2013 16:45

EdB wrote:At present I assume the only method to generate the POCOs in the addin is to save the model. There is no green "generate code" button.... or is there?
There is no "generate code" button in Entity Developer which is integrated in Visual Studio. The code should be generated if you press the Save button (when the model is opened and its window is active) or Save All.
EdB wrote:The issue was that the POCOs were being generated, but were not showing in VS2012 until I refreshed, and then they were not included in the project.
Please specify:
1) the exact type of your project (e.g.: Web Site or ASP.NET Web Application)
2) programming language (С# or VB)

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by EdB » Wed 13 Mar 2013 17:08

Hi,

Thanks for this.

Just discovered that the green button in VS is in effect "Run Custom Tool" which you get to via right clicking on the EDML file. This does the job, although a little subtle to find.

The project type is "Class Library" since I am creating the EF Model in its own project. I am using C#.

Thanks.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by Shalex » Thu 14 Mar 2013 08:59

Is the issue solved? If not, please specify the exact problem you are experiencing at the moment.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: Cannot generate POCOs from membership provider tables, puzzled?

Post by EdB » Thu 14 Mar 2013 14:06

Yes I am happy. Thank you for your help.

Post Reply