mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-06-30 02:31:08 +00:00
28 lines
626 B
C#
28 lines
626 B
C#
using System;
|
|
using MediatR;
|
|
|
|
namespace CleanArchitecture.Domain.Commands.Users.LoginUser;
|
|
|
|
public sealed class LoginUserCommand : CommandBase,
|
|
IRequest<string>
|
|
{
|
|
private readonly LoginUserCommandValidation _validation = new();
|
|
|
|
|
|
public LoginUserCommand(
|
|
string email,
|
|
string password) : base(Guid.NewGuid())
|
|
{
|
|
Email = email;
|
|
Password = password;
|
|
}
|
|
|
|
public string Email { get; set; }
|
|
public string Password { get; set; }
|
|
|
|
public override bool IsValid()
|
|
{
|
|
ValidationResult = _validation.Validate(this);
|
|
return ValidationResult.IsValid;
|
|
}
|
|
} |