Silverlight client using WCF RIA Services support for DataAnnotations
Posted: Tue Jun 28, 2011 5:19 pm
Hi, just started evaluating this. V. impressed with the product. However, the tool appears not to look at DataAnnotations when used as a business object.
eg I have metadata defined:
// The MetadataTypeAttribute identifies CompanyMetadata as the class
// that carries additional metadata for the Company class.
[MetadataTypeAttribute(typeof(Company.CompanyMetadata))]
public partial class Company
{
// This class allows you to attach custom attributes to properties
// of the Company class.
//
internal sealed class CompanyMetadata
{
// Metadata classes are not meant to be instantiated.
private CompanyMetadata()
{
}
[Display(AutoGenerateField = false)]
public long CompanyID { get; set; }
[Display(Order = 2, Name = "Company Number")]
public string CustomerNumber { get; set; }
etc.
I'd like to have the report designer honour these. So in the above the CompanyID field would not be displayed and CompanyNumber would become Company Number
I guess you use reflection to get the objects so what's the chance of implementing?
Thanks, Martin
eg I have metadata defined:
// The MetadataTypeAttribute identifies CompanyMetadata as the class
// that carries additional metadata for the Company class.
[MetadataTypeAttribute(typeof(Company.CompanyMetadata))]
public partial class Company
{
// This class allows you to attach custom attributes to properties
// of the Company class.
//
internal sealed class CompanyMetadata
{
// Metadata classes are not meant to be instantiated.
private CompanyMetadata()
{
}
[Display(AutoGenerateField = false)]
public long CompanyID { get; set; }
[Display(Order = 2, Name = "Company Number")]
public string CustomerNumber { get; set; }
etc.
I'd like to have the report designer honour these. So in the above the CompanyID field would not be displayed and CompanyNumber would become Company Number
I guess you use reflection to get the objects so what's the chance of implementing?
Thanks, Martin