Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
577 B

using System;
using Volo.Abp.Validation.StringValues;
namespace Volo.Abp.FeatureManagement;
[Serializable]
[ValueValidator("URL")]
public class UrlValueValidator : ValueValidatorBase
{
public string Scheme {
get => this["Scheme"].ToString();
set => this["Scheme"] = value;
}
public UrlValueValidator()
{
}
public UrlValueValidator(string scheme)
{
Scheme = scheme;
}
public override bool IsValid(object value)
{
var s = value.ToString();
return s != null && s.StartsWith(Scheme);
}
}