?
Solved

Entity Framework 4.0 and pluralization

Posted on 2011-03-10
3
Medium Priority
?
755 Views
Last Modified: 2012-06-27
I love both EF4 and Dynamic Data. I need to create a URL that will render with a Dynamic Data page, but find that pluralization is a problem. I have the actualk table name (e.g. attachment), but EF4 referes to that file as attachments.

Is there a map in EF4 that I can use and thereby create a url using attachments?

Thanks,
newbieweb
0
Comment
Question by:newbieweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 41

Expert Comment

by:graye
ID: 35109298
I'm confused... the whole point of using entities is that your NOT using the database structure.  It was designed to provide a separation between the business logic of your app and the data access of your app.  So, it should not be suprising that the entity collections do not match the table names.  

The Dynamic Data template is designed to use entities... and not directly touch the database tables.

... unless I've complete missed the point?
0
 

Accepted Solution

by:
newbieweb earned 0 total points
ID: 35111078
No, you are right about that. But we need to configure the Dynamic Data website to group the tables by the user's role, and in some cases hide the table altogether. So we created a DB_tables table with a few extra properties than the table name. But when creating the URL for the Dynamic Data, I need the following code to transpose the original table name into the entity name:

using System.Globalization;

public string GetPluralization(string singular)
{
   var pluralizer = PluralizationService.CreateService(CultureInfo.GetCultureInfo("en"));
   return pluralizer.Pluralize(singular);            
}
0
 

Author Closing Comment

by:newbieweb
ID: 35145544
So I am satisfied this works fine.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question