mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
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
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);
|
|
}
|
|
}
|
|
|