Page 1 of 1
Cannot generate POCOs from membership provider tables, puzzled?
Posted: Tue 12 Mar 2013 01:20
by EdB
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.
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Tue 12 Mar 2013 17:29
by Shalex
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.
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Tue 12 Mar 2013 21:06
by EdB
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.
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Wed 13 Mar 2013 16:45
by Shalex
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)
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Wed 13 Mar 2013 17:08
by EdB
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.
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Thu 14 Mar 2013 08:59
by Shalex
Is the issue solved? If not, please specify the exact problem you are experiencing at the moment.
Re: Cannot generate POCOs from membership provider tables, puzzled?
Posted: Thu 14 Mar 2013 14:06
by EdB
Yes I am happy. Thank you for your help.