I have a problem attaching metadata class to ADO.NET entity data model generated classes. According to the following links...
http://msdn.microsoft.com/en-us/library/cc679243.aspx
I created a metadata class to add some Attributes to properties. I could add this attributes to properties in generated classes and It works but I wanted to avoid loosing this attributes every time I have to update and recreate my ADO.NET entity data model.
My question is, what am I doing wrong ? Why in runtime properties does not have my custom attributes ?
This is a part of generated data class
[EdmEntityTypeAttribute(NamespaceName="HelpMeHowModel", Name="Article")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
[MetadataType(typeof(ArticleMetaData))]
public partial class Article : EntityObject
{
#region Primitive Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Boolean IsPublished
{
get
{
return _IsPublished;
}
set
{
OnIsPublishedChanging(value);
ReportPropertyChanging("IsPublished");
_IsPublished = StructuralObject.SetValidValue(value);
ReportPropertyChanged("IsPublished");
OnIsPublishedChanged();
}
}
private global::System.Boolean _IsPublished;
partial void OnIsPublishedChanging(global::System.Boolean value);
partial void OnIsPublishedChanged();
...
.. and this is my metadata class
public class ArticleMetaData
{
#region Primitive Properties
[BoolFunction(BoolFunction.ThreeStateRadioButton)]
public global::System.Boolean IsPublished { get; set; }