lundi 16 mars 2015

Custom data annotation with RIa Services

I have a Silverlight application and I'm using Entity Framework and Ria Services.


I need to create a custom attribute that I will use to recognize some properties.


Ex. :



public class Person
{
[IsSpecialProperty]
public string PersonProperty { get; set; }
}

public class IsSpecialPropertyAttribute : Attribute
{

}


I named the class file "IsSpecialPropertyAttribute.shared.cs" to access it from the client.


And from the client side, I use the method :



var attributes = (IsSpecialPropertyAttribute[])Attribute.GetCustomAttributes(memberInfo, typeof(IsSpecialPropertyAttribute));


This method is working for system attributes but not with my custom attribute...


Any idea why ?






Aucun commentaire:

Enregistrer un commentaire