Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending a Entity Class with a Partial Class....unsupported type error
    primarykey
    data
    text
    <p>I must be doing something really wrong as this seems like a very simple extension that causes an error when you try to compile the code.</p> <p>So...we have a Customer Table and in that table we have a Customer_ID. We only store the Customer ID and the rest of the data comes from a Customer Truth Center.</p> <p>This Customer table is referenced and creates a Entity Customer object when we generate our entity EDMX file.</p> <p>We take this Customer ID and fetch the rest of the Customer info from a WCF service thats our Customer truth center. This returns the Name, Age and such.</p> <p>So...we want to extend the existing Customer entity with these additional properties however we done "persist" these in our Customer database.</p> <p>Hence we created a Partial Class to extend our Entity Customer like this:</p> <pre><code>namespace UsingRIAServices.Web.Models { public partial class Customer { public string Name { get; set;} public int Age { get; set;} } } </code></pre> <p>This didnt work and when you build you get the following error.</p> <p>Entity "UsingRIAServices.Web.Models.Customer' has a property 'CustomerReference' with an supported type.</p> <p>So...if you go into the Customer.Designer.cs you see this propery</p> <pre><code>/// &lt;summary&gt; /// No Metadata Documentation available. /// &lt;/summary&gt; [BrowsableAttribute(false)] [DataMemberAttribute()] public EntityReference&lt;Customer&gt; CustomerReference { blah, blah } </code></pre> <p>And note the type Customer in the EntityReference which is now an extended class with our partial.</p> <p>So...I added [Datamember] to each item in our partial class...same error. I tried to [Exclude] it and get the same error.</p> <p>Why is something that seems so simple and direct so difficult. Please help us figure out how to extend an entity partial class. Can you do this with data that is not in the table?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload