mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 03:56:30 +00:00
721ee8e494
* Move shared code to Shared project * Move from Realm to Squealify * Rename Daybreak.Shared namespaces * Setup API project to expose a test API
21 lines
416 B
C#
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;
|
|
}
|
|
}
|
|
}
|