Files
Daybreak/Daybreak.Shared/Validators/BooleanValidator.cs
T
amacocian 721ee8e494 Huge application refactoring to better support plugins (#960)
* Move shared code to Shared project
* Move from Realm to Squealify
* Rename Daybreak.Shared namespaces
* Setup API project to expose a test API
2025-05-14 16:15:27 +02:00

21 lines
416 B
C#

namespace Daybreak.Shared.Validators;
public sealed class BooleanValidator : IValidator
{
public bool IsValid(object value)
{
if (value is string stringValue &&
bool.TryParse(stringValue, out _))
{
return true;
}
else if (value is bool)
{
return true;
}
else
{
return false;
}
}
}