I have a data contract class with data members in my WCF project and I want to reference them in my MVC project so I can apply data annotation validation to them
I can use the class object in my MVC project already the only problem is the validation.
In my WCF project my class has a property called PeopleOnTourCount
:
namespace VBSClient.BookingServiceClient
{
[DataContract]
[MetadataType(typeof(BookingTypeMetaData))]
public partial class BookingType
{
public BookingType() { }
}
public class BookingTypeMetaData {
[Required]
[Display(Name="People Count")]
[DataMember]
public int PeopleOnTourCount { get; set; }
}
}
I can't access any of my original properties inside the constructor and the annotations aren't binding either.