CSV Import command created

This commit is contained in:
Geoffroy BONNEVILLE
2020-06-05 19:08:29 +02:00
parent 1f04f941c2
commit 4e7aca5517
10 changed files with 78 additions and 51 deletions

View File

@@ -0,0 +1,22 @@
using FluentValidation;
namespace ModernKeePass.Application.Database.Commands.CreateDatabase
{
public class CreateDatabaseCommandValidator : AbstractValidator<CreateDatabaseCommand>
{
public CreateDatabaseCommandValidator()
{
RuleFor(v => v.FilePath)
.NotNull()
.NotEmpty();
RuleFor(v => v.Password)
.NotNull()
.NotEmpty()
.When(v => string.IsNullOrEmpty(v.KeyFilePath));
RuleFor(v => v.KeyFilePath)
.NotNull()
.NotEmpty()
.When(v => string.IsNullOrEmpty(v.Password));
}
}
}