문제

I am making a WCF service, and I want to make certain DataMembers which are string values of my requests required (i.e., not null, not empty), because we have institutional/legal access logging requirements to sensitive data (we need to log by whom and when the access was made)

I'm guessing that some of this is the fact that my DataMembers are strings, and that strings that are null can be valid. Can anyone help me with this definition?

namespace CrdWcfServiceInterface.Request
{
    [DataContract]
    public class GetPatientDemographicsRequest
    {
       [DataMember]
       public string PatientID { get; set; }
       [DataMember(IsRequired=true)]
       public string RequesterLanID { get; set; }
       [DataMember(IsRequired=true)]
       public string ApplicationName { get; set; }

    }
}
도움이 되었습니까?

해결책

Please take a look at integrating the Enterprise library blocks to handle the validation alongwith WCF as shown here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top