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 7050041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:05:42+00:00 2026-05-28T03:05:42+00:00

I have these two related tables Client (ClientId, Name) and ClientDescription (ClientDescriptionId, (FK) ClientId,

  • 0

I have these two related tables Client (ClientId, Name) and ClientDescription (ClientDescriptionId, (FK) ClientId, Description). That is to say each Client can have many associated descriptions. Now, when displaying the a list of ClientDescriptions, I also need to know what the Name of it’s associated Client is.

Now you’ll probably say that I allready have this information, since I can simply follow my navigation property back to the associated Client and use its Name. I can’t do that because I’m autogenerating a grid in Ria services, and this just gives me a count for navigation properties, and I haven’t found a way to flatten this down in my metadata file. Hence why I want a property.

The whole idea is that I want to be able to add a new field to my database, update my entity classes from the database and regenerate my domain service, and the new field should just pop up in my grid. I shouldn’t have to update my xaml just because my database happen to have an extra field.

So, what I would like to do is add a ClientName field to the entity (clr object), but keep my database clean (no such denormalization in the db).

So, I generated my edmx, and added a new property named ClientName. Set it to StoreGeneratedPattern.Computed, and compiled. I then get a nasty little error

Error 3004: Problem in mapping fragments starting at line NN: No mapping specified for properties (etc..)

The solution apparently is to generate my database from my edmx. (Or that’s what answers to questions about that error seems to yield.) But this generates an actual DB-field, which I don’t want, so that answer doesn’t apply to my case.

So my question is: How can I denormalize my clr entity, but keep my db tables normalized?

Edit: I guess this question can be generalized a bit. The issue would be the same if ClientDescription contained a few numeric fields that I wanted to do some calculations on, and I wanted the result available as a field and the algorithm should be in c# rather than in my database.

  • 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-28T03:05:43+00:00Added an answer on May 28, 2026 at 3:05 am

    To answer your more generalized question:

    Entities are generated by the Entity Framework with a partial keyword.
    This means that the code of an entity can be split in multiple source files in the same namespace and assembly. One will contain the generated code from the Entity Framework, the other will contain custom properties and methods.

    If for example, your entity has the database fields Price and Amount you could add a property in the partial class TotalPrice which would return Price * Amount.

    Then the algorithm will be C# and your database won’t know about the extra property.

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

Sidebar

Related Questions

I have two tables: Designs and Urls. A Design can be related to many
I have two tables that are related, which, for the purpose of this question,
I have these two methods on a class that differ only in one method
Say you have these two methods: Number 1: void AddPerson(Person person) { // Validate
Let's say we have these two classes: public class Base { public static int
If I have these two tables: <table> <tr> <td>Small Length Content</td> </tr> </table> <table>
I have two related sql server tables ... TableA and TableB. ***TableA - Columns***
I have two tables (tbArea, tbPost) that relate to the following classes. class Area
I have these two tables in MySql: [Person] PersonId NameFirst NameLast [Email] EmailId PersonId
I have two tables in APEX that are linked by their primary key. One

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.