1

Closed

DataContract attributes doesn't apply to derived types

description

[DC]<br />public class A<br />{<br />[Key]<br />[DM]<br />public int Id {get; set; }<br /><br />public string Name { get; set; }<br />}<br />public class B : A<br />{<br />}<br /><br />builder.EntitySet<A>("A");<br /><br />The generated $metadata will be: <br /> <EntityType Name="A"><br /> <Key><br /> <PropertyRef Name="Id" /><br /> </Key><br /> <Property Name="Id" Type="Edm.Int32" Nullable="false" /><br /> </EntityType><br /> <EntityType Name="B" BaseType="A"><br /> <Property Name="Name" Type="Edm.String" /><br /> </EntityType><br /><br />The member won't be shown in base type's model, but still show in derived type's model.<br /><br />
Closed Jan 18, 2013 at 10:42 PM by hongyes
Verified

comments

HongmeiG wrote Oct 8, 2012 at 11:43 PM

DCS will not emit Name property, so we should not emit in our metadata either.