src/EasyFrameWork/ViewPort/Validator/RemoteValidator.cs

(完整代码) 1KB

/* http://www.zkea.net/ 
 * Copyright (c) ZKEASOFT. All rights reserved. 
 * http://www.zkea.net/licenses */

using System;
using Easy.Extend;
using Microsoft.Extensions.DependencyInjection;

namespace Easy.ViewPort.Validator
{
    public class RemoteValidator : ValidatorBase
    {
        public RemoteValidator()
        {
            BaseErrorMessage = "{0} is invalid";
        }
        public string Url
        {
            get
            {
                string url = string.Format("/{0}/{1}", Controller, Action);
                if (!string.IsNullOrEmpty(Area))
                {
                    url = string.Format("/{0}/{1}", Area, url);
                }
                var app = ServiceLocator.GetService<IApplicationContext>();
                if (app != null)
                {
                    url = string.Format("{0}{1}", "", url);
                }
                return url;
            }
        }
        public string Action { get; set; }
        public string Controller { get; set; }
        public string Area { get; set; }

        public string AdditionalFields { get; set; }

        public override bool Validate(object value)
        {
            return false;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。