using Core.Abstractions.Models;
using Core.Enumerations;
using System.ComponentModel.DataAnnotations;
namespace WeatherForecast.Models.Requests {
  /// 
  /// 
  /// 
  public class AuthenticationRequestModel : RequestModelBase {
    /// 
    /// 
    /// 
    public string? Username { get; set; }
    /// 
    /// 
    /// 
    public string? Password { get; set; }
    /// 
    /// 
    /// 
    /// 
    /// 
    public override IEnumerable Validate(ValidationContext validationContext) {
      if(string.IsNullOrWhiteSpace(Username))
        yield return new ValidationResult($"{nameof(Username)} ${Errors.NullOrEmpty}");
      if (string.IsNullOrWhiteSpace(Password))
        yield return new ValidationResult($"{nameof(Password)} ${Errors.NullOrEmpty}");
    }
  }
}