Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> EF Projects Generate Pluralized DbSet Property Names but Singular ConceptualModel/EntitySet Names
 

Pages: 1
LLBLGen Pro Runtime Framework
EF Projects Generate Pluralized DbSet Property Names but Singular ConceptualModel/EntitySet Names
Page:1/1 

  Print all messages in this thread  
Poster Message
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 10-May-2015 22:47:58.  
I'm using the WCF Data Services and have run into a problem with pluralisation. My table names are plural and I'm using the default LLBLGen Designer Event Binding to convert Plural table names into Singular entity names. That's fine.

The DataContext source file that is generated is producing DbSet<T> properties which are plural. That's good too.

However, the EDMX file that is generated is producing EntitySet elements under the edmx:ConceptualModel with Name attributes that are singular and this is causing my WCF Data Service to produce URLs in the singular form to represent entity sets! I've confirmed this by hand-editing the EntitySet element Name attributes in the generated EDMX to use plural names (and then editing all the EntitySetMapping elements under the edmx:Mappings element to match) and then rebuilding my Persistence project and WCF Data Service project to see that the URLs are pluralized.

How do I make LLBLGen generate plural EntitySet Name attributes in the EDMX? As far as I'm concerned they should match the names used in the DataContext properties.

Using v4.2 Feb 16 2015. .NET 4.5. I've tried with both EF5 and EF6 - same result.
  Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 11-May-2015 02:19:54.  
Emmanuel wrote:
the EDMX file that is generated is producing EntitySet elements under the edmx:ConceptualModel with Name attributes that are singular


I found an old thread from 2010 (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=18507&HighLight=1) that seems to be referencing the same issue but which Frans indicated was behaviour that would not be changed.

Can I get a comment on how I can solve this problem?


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37860 posts
# Posted on: 11-May-2015 11:54:33.  
This is indeed unfortunate. The main issue I think is that it was originally designed to have all singular names, but we fixed that but forgot the edmx internal names. These aren't available outside the EDMX, however are problematic with the wcf data service it seems as it leverages these names.

If you generate code using the Code First preset, you should be able to work around this, as you then don't get an edmx (it's regenerated by entity framework internally at app startup). Could you try that for me please?

If you want to keep using edmx (or have to, due to limitations in EF6's CF), you have to alter the template but the names of entities are in a lot of places so it's not that simple. We can't change it now as it's a breaking change. If CF works around it, I'd go that route.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 11-May-2015 18:22:43.  
Otis wrote:
If you generate code using the Code First preset, you should be able to work around this, as you then don't get an edmx (it's regenerated by entity framework internally at app startup). Could you try that for me please?

I tried this and got an exception: 'Unable to load the specified metadata resource' when attempting to access the svc URL.

Otis wrote:
If you want to keep using edmx (or have to, due to limitations in EF6's CF), you have to alter the template but the names of entities are in a lot of places so it's not that simple.

Indeed I tried changing the template but gave up after seeing how many other places (associations and mappings, etc) the names are used.

I'm afraid I've spent too much time with this problem. I've moved onto using the Visual Studio Database First Modelling instead Angry I'll continue to use LLBLGen for my other LLBLGen-framework project though Regular Smiley




  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37860 posts
# Posted on: 12-May-2015 09:35:38.  
Emmanuel wrote:
Otis wrote:
If you generate code using the Code First preset, you should be able to work around this, as you then don't get an edmx (it's regenerated by entity framework internally at app startup). Could you try that for me please?

I tried this and got an exception: 'Unable to load the specified metadata resource' when attempting to access the svc URL.

Did you use the right wcf dataservices dll ? They have updated the one shipped with vs.net to support code first.

Quote:

Otis wrote:
If you want to keep using edmx (or have to, due to limitations in EF6's CF), you have to alter the template but the names of entities are in a lot of places so it's not that simple.

Indeed I tried changing the template but gave up after seeing how many other places (associations and mappings, etc) the names are used.

I'm afraid I've spent too much time with this problem. I've moved onto using the Visual Studio Database First Modelling instead Angry I'll continue to use LLBLGen for my other LLBLGen-framework project though Regular Smiley

Hmm, very sorry to hear you have to use that horrible designer instead and we couldn't help you Dissapointed
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 12-May-2015 13:54:55.  
Otis wrote:
Did you use the right wcf dataservices dll ? They have updated the one shipped with vs.net to support code first.

Good question. When I have time I'll investigate.

Quote:
Hmm, very sorry to hear you have to use that horrible designer instead and we couldn't help you Dissapointed

Indeed. I already am having LLBLGen Designer withdrawal symptoms. I'll give it another try when I have less of a deadline crunch and hopefully I can get back to using LLBLGen (code first) with EF6.

Edit: I'm leaving this thread open for now. I'll report back after I've had time to try this again with the correct Microsoft.Data.* assemblies that support code-first.


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37860 posts
# Posted on: 12-May-2015 17:27:54.  
Regular Smiley Yeah wcf data services is a bit of a mess, so it's easy to get the wrong dlls. You have to use the last 5.x versions from nuget, if you want odata v1-3 and the v6.x if you want odata v4.

hopefully you'll be able to make it work so you don't have to fight the ef designer Wink
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.