Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Project MVC and my project support multi language So

i had this tables
User Table :
C#
public partial class User
   {
       public int Id { get; set; }
       public string Name { get; set; }
       public Nullable<int> GenderID { get; set; }

       public virtual Gender Gender { get; set; }
   }


and Gender Table:
C#
public partial class Gender
 {
     public Gender()
     {
         this.GenderTranslates = new HashSet<GenderTranslate>();
         this.Users = new HashSet<User>();
     }

     public int Id { get; set; }
     public string Icon { get; set; }
     public string Value { get; set; }

     public virtual ICollection<GenderTranslate> GenderTranslates { get; set; }
     public virtual ICollection<User> Users { get; set; }
 }



and language Table:
C#
public partial class Lang
{
    public Lang()
    {
        this.GenderTranslates = new HashSet<GenderTranslate>();
    }

    public int Id { get; set; }
    public string Name { get; set; }

    public virtual ICollection<GenderTranslate> GenderTranslates { get; set; }
}



and GenderTranslate Table :

C#
public partial class GenderTranslate
{
    public int LangID { get; set; }
    public int GenderID { get; set; }
    public string Desc { get; set; }

    public virtual Gender Gender { get; set; }
    public virtual Lang Lang { get; set; }
}


when i get users i need to get GenderTranslate.Desc
not Gender.Value

How i can Do that in MVC Entity Framework Plz Help me
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900