Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6358155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:18:50+00:00 2026-05-24T23:18:50+00:00

I would like to mention that i am new to EF. I am creating

  • 0

I would like to mention that i am new to EF.

I am creating the Data Access library with EF 4.1.

For each Entity I have two tables for translation target.

ex : Events ==> Event_ar for Arabic and Event_en for English.

First Problem : I have an error if i write two DbSets of same Entity Type

so I did this work around which is absolutely not nice :

public class Event_en : Event { }
public class Event_ar : Event { }

public class DB : DbContext
{
    public DbSet<Event_ar> Events_ar { get; set; }
    public DbSet<Event_en> Events_en { get; set; }
}

I would like to know if there is a solution for it?

Second one
The Entity should be same name as a table, otherwise i have an error.

Ex : “dbo.Event_ar” should have a POCO “Event_ar”

It should be the name of the property that has the same name of the table.

Here : dbo.Events_ar ==> POCO “Events_ar”

Why I can’t manipulate the names? Any solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:18:50+00:00Added an answer on May 24, 2026 at 11:18 pm

    I’m not sure if your solution is going in the right direction. It doesn’t feel right to have a table for every language – you could simply add another column to the event table that specifies what the language is?

    The you could use this column to retrieve the row with the desired language.

    About tables and POCO entity names, you can override the table the entity is mapped to either through the use of a System.ComponentModel.TableAttribute at the class elvel, but to maintain POCO-ness I like to use EntityTypeConfiguration classes and specify the table name.

    for example:

    public class CurrencyConfiguration : EntityTypeConfiguration<Currency>
        {
            public CurrencyConfiguration()
            {
                this.ToTable("Conv", "Ref");           
            }
        }
    

    Then you add it to the model builder in the OnModelCreating override method on the DbContext.

    public class MyContext : DbContext
    {
        public DbSet<Currency> Currencies { get; set; }
    
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new CurrencyConfiguration());           
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to mention before continuing that I have looked at other questions
I would like to store data in Generic Dictionary with keys that match over
I have recently designed a web application that I would like to write in
First, I would like to mention that I also had this problem when 2.2
The documentation about List mention that itemTpl follows the XTemplate syntax. I would like
I have an @activity that has_many :clientships When creating a new object I assign
Would like a for loop in jquery so that: For every hover_link: show hidden
Would like to make anapplication in Java that will not automatically parse parameters used
First off, I would like to mention the question is a homework question. I
My LogIn action originally looked like this: return new RedirectResult(nameValueCollection[ReturnUrl]); But, I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.