28 lines
		
	
	
		
			706 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			706 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using Core.Abstractions.Models;
 | |
| using Core.Enumerations;
 | |
| using System.ComponentModel.DataAnnotations;
 | |
| 
 | |
| namespace WeatherForecast.Models.Requests {
 | |
| 
 | |
|   /// <summary>
 | |
|   /// 
 | |
|   /// </summary>
 | |
|   public class PasswordRequestModel : RequestModelBase {
 | |
| 
 | |
|     /// <summary>
 | |
|     /// 
 | |
|     /// </summary>
 | |
|     public string? Password { get; set; }
 | |
| 
 | |
|     /// <summary>
 | |
|     /// 
 | |
|     /// </summary>
 | |
|     /// <param name="validationContext"></param>
 | |
|     /// <returns></returns>
 | |
|     public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext) {
 | |
|       if (string.IsNullOrWhiteSpace(Password))
 | |
|         yield return new ValidationResult($"{nameof(Password)} ${Errors.NullOrEmpty}");
 | |
|     }
 | |
|   }
 | |
| }
 |