mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-01 19:12:57 +00:00
34 lines
836 B
C#
34 lines
836 B
C#
using System;
|
|
|
|
namespace CleanArchitecture.Domain.Commands.Users.CreateUser;
|
|
|
|
public sealed class CreateUserCommand : CommandBase
|
|
{
|
|
private readonly CreateUserCommandValidation _validation = new();
|
|
|
|
public CreateUserCommand(
|
|
Guid userId,
|
|
string email,
|
|
string firstName,
|
|
string lastName,
|
|
string password) : base(userId)
|
|
{
|
|
UserId = userId;
|
|
Email = email;
|
|
FirstName = firstName;
|
|
LastName = lastName;
|
|
Password = password;
|
|
}
|
|
|
|
public Guid UserId { get; }
|
|
public string Email { get; }
|
|
public string FirstName { get; }
|
|
public string LastName { get; }
|
|
public string Password { get; }
|
|
|
|
public override bool IsValid()
|
|
{
|
|
ValidationResult = _validation.Validate(this);
|
|
return ValidationResult.IsValid;
|
|
}
|
|
} |