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

  • Home
  • SEARCH
  • 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 6561059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:32:26+00:00 2026-05-25T13:32:26+00:00

Using VS2010, .NET4.0, MVC3, EF4.1 Code-First I have this POCO entities: public class XBLContent

  • 0

Using VS2010, .NET4.0, MVC3, EF4.1 Code-First

I have this POCO entities:

public class XBLContent
{
    [Key]
    [StringLength(36, ErrorMessage="Must have 36 characters")]
    [Required(ErrorMessage="Must have a unique GUID")]
    public string GUID { get; set; }

    public int Price { get; set; }

    public float FileSize { get; set; }

    public virtual ICollection<XBLRegionalContent> RegionalInfo { get; set; }

    public string RelatedGameId { get; set; }
    [ForeignKey("RelatedGameId")]
    public virtual XBLContent RelatedGame { get; set; }
}

public class XBLRegionalContent
{
    [Key, Column(Order = 0)]
    public string ContentId { get; set; }
    [ForeignKey("ContentId")]
    public virtual XBLContent Content { get; set; }

    [Key, Column(Order = 1)]
    public string RegionId { get; set; }
    [ForeignKey("RegionId")]
    public virtual XBLRegion Region { get; set; }

    public string Name { get; set; }
}

public class XBLRegion
{
    [Key]
    [StringLength(5, ErrorMessage="ID must have 5 characters")]
    [Required]
    [RegularExpression(@"[a-z|A-Z]{2}-[A-Z|a-z]{2}")] 
    public string ID { get; set; }

    public string Country { get; set; }

    public string Language { get; set; }
}

Relationships:

  • One XBLContent has many XBLRegionalContent;
  • One XBLContent can be related to another XBLContent(most of them are not);
  • One XBLRegionalContent has one XBLContent and one XBLRegion;
  • One XBLRegion has many XBLRegionalContent;

The Context objetc is really simple:

public class XBLContentContext : DbContext
{
    public DbSet<XBLContent> XBLContents { get; set; }
    public DbSet<XBLRegionalContent> XBLRegionalInfos { get; set; }
    public DbSet<XBLRegion> XBLRegion { get; set; }

    public XBLContentContext() : base("XBLToolsDB")
    {
    }
}

I’m using XBLContent as my main business object and maybe that is not the best idea. I think there is something wrong with the architecture I designed because I’m having trouble to send information to the View and filter, sort, etc.

Now, I’m using Telerik grid and when I try to sort by a navigation property field I get an error saying that “No property or field exist”. Maybe I should not use XBLContent as my main business object, or create a ViewModel containing all needed fields and send it to the View. Or create one single entity that splits into two EF tables(I don’t know if that is possible or how to achieve that).

I’m just padawan in .NET and need some Jedi Masters advice.

I need contents that can have multiple translations.

How to best achieve this goal?

  • 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-25T13:32:27+00:00Added an answer on May 25, 2026 at 1:32 pm

    I’m assuming you’re using the Telerik MVC Extensions here, but if you are using a different product please let me know and I’ll re-answer accordingly 🙂

    In regards to the Grid what kind of binding are you utilizing? If you are using regular server or ajax binding then you might run into some issues when binding to a navigational property, as by default these bindings only work with primitive (int, string etc.) types. However, there is such a thing as custom binding which allows you to take full control over paging/sorting/filtering. I believe this could account for why you are getting this error, as the automatic LINQ expressions cannot find the specific field you are looking for. Here are two demos (which have source code for both WebForms and Razor ViewEngines) that can help with setting up custom binding. It’s just a little more work than the automatic binding, but should still work (note that these examples are using Razor):

    • Ajax Binding
    • Server Binding

    The added benefit here is that you get to control everything on your own, which can be quite nice in somewhat more complex scenarios. If you’re already using custom binding, and/or if the links there do not help let me know. It could also be helpful to have the code for the Telerik Grid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2: smtpClient.Send(mailMsg);
I have a WPF application running with VS2010 .Net3.5 using Nhibernate with FluentNHibernate +
I am using MVC2 in VS2010 with .Net 4.0. I have a situation in
Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Can someone provide me with a HelloWorld JQuery sample app using VS2010 and list
I tried file system publish and ftp I'm using VS2010 and .net 4.0 should
I'm running a weird issue here. I have code that makes jquery ajax calls

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.