mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Most services are implemented as command/queries
Code cleanup
This commit is contained in:
@@ -6,7 +6,17 @@ namespace ModernKeePass.Application.Database.Queries.OpenDatabase
|
||||
{
|
||||
public OpenDatabaseQueryValidator()
|
||||
{
|
||||
RuleFor(v => v.Credentials != null && v.FileInfo != null);
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user