Esempio n. 1
0
 /// <summary>
 /// Validate the Create and Edit requests for presence of values for Required fields.
 /// </summary>
 /// <param name="group"></param>
 private void ValidateGroup(Group group)
 {
     ModelValidationHelper.ValidateStringProperty(ModelState, group.displayName, "DisplayName", "DisplayName is required.");
     ModelValidationHelper.ValidateStringProperty(ModelState, group.mailNickname, "MailNickname", "MailNickname is required.");
     ModelValidationHelper.ValidateProperty(ModelState, group.securityEnabled, "SecurityEnabled", "SecurityEnabled is required.");
 }
 /// <summary>
 /// Validate User object for Edit requests.
 /// </summary>
 private void ValidateUserForEdit(User user, string emailAlias)
 {
     ModelValidationHelper.ValidateStringProperty(ModelState, user.displayName, "DisplayName", "DisplayName is required.");
     ModelValidationHelper.ValidateStringProperty(ModelState, emailAlias, "UserPrincipalName", "UserPrincipalName is required.");
     ModelValidationHelper.ValidateProperty(ModelState, user.accountEnabled, "AccountEnabled", "AccountEnabled is required.");
 }