3

Is it possible to name the class/ViewModel for a WebAPI response object using System.ComponentModel.DataAnnotations or is there an alternative;

//[DataMember(Name="CarDepot")] -- this doesn't work
//[Display(Name = "CarDepot")] -- this doesn't work
public partial class CarDepotVM
{
    [Display(Name = "CarDepotVM")]
    [DataMember(Order = 0)]
    [Required]
    public Car[] Cars { get; set; }
}

The library which contains the following code is PCL complaint, therefore I cannot use any external libraries which aren't compatible.

wonea
  • 4,783
  • 17
  • 86
  • 139
  • possible duplicate of [Is there any way I can implement IValidatableObject on Portable Class Library Project?](http://stackoverflow.com/questions/16023742/is-there-any-way-i-can-implement-ivalidatableobject-on-portable-class-library-pr) – Andy Mar 20 '14 at 18:47

0 Answers0