/// <summary> /// Validates this RequestedService /// </summary> /// <param name="path">The path to this object as a string</param> /// <param name="messages">the validation messages to date, these may be added to within this method</param> public void Validate(string path, List <ValidationMessage> messages) { var vb = new ValidationBuilder(path, messages); vb.ArgumentRequiredCheck("RequestedServiceDateTime", RequestedServiceDateTime); if (ServiceCommencementWindow != null) { ServiceCommencementWindow.Validate(vb.Path + "ServiceCommencementWindow", vb.Messages); } // var choice1 = new Dictionary<string, object> // { // { "ServiceCommencementWindow", ServiceCommencementWindow }, // { "ServiceScheduled", ServiceScheduled } // }; // // vb.ChoiceCheck(choice1); // if (vb.ArgumentRequiredCheck("RequestedServiceDescription", RequestedServiceDescription)) { if (RequestedServiceDescription != null) { RequestedServiceDescription.ValidateMandatory(vb.Path + "RequestedServiceDescription", vb.Messages); } } vb.ArgumentRequiredCheck("ServiceBookingStatus", ServiceBookingStatus); if (ServiceProvider != null) { ServiceProvider.Validate(vb.Path + "ServiceProvider", vb.Messages); } }
/// <summary> /// Validate the Content for this Requested Service /// </summary> /// <param name="path">The path to this object as a string</param> /// <param name="messages">the validation messages, these may be added to within this method</param> public void Validate(string path, List <ValidationMessage> messages) { var vb = new ValidationBuilder(path, messages); if (vb.ArgumentRequiredCheck("RequestedServiceDescription", RequestedServiceDescription)) { RequestedServiceDescription.Validate(vb.Path + "RequestedServiceDescription", vb.Messages); } vb.ArgumentRequiredCheck("ServiceBookingStatus", ServiceBookingStatus); if (vb.ArgumentRequiredCheck("ServiceRequester", ServiceRequester)) { ServiceRequester.Validate(vb.Path + "ServiceRequester", vb.Messages); } vb.ArgumentRequiredCheck("RequestedServiceDateTime", RequestedServiceDateTime); if (vb.ArgumentRequiredCheck("RequestIdentifier", RequestIdentifier)) { RequestIdentifier.Validate(vb.Path + "RequestIdentifier", vb.Messages); } if (vb.ArgumentRequiredCheck("RequestedServiceInstanceIdentifier", RequestedServiceInstanceIdentifier)) { RequestedServiceInstanceIdentifier.Validate(vb.Path + "RequestedServiceInstanceIdentifier", vb.Messages); } if (vb.ArgumentRequiredCheck("DetailedClinicalModelIdentifier", DetailedClinicalModelIdentifier)) { DetailedClinicalModelIdentifier.Validate(vb.Path + "DetailedClinicalModelIdentifier", vb.Messages); } }