Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Entity Framework 4.0 and pluralization

Posted on 2011-03-10
3
Medium Priority
?
756 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 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