Example #1
0
        public static bool IsOk(this FluentValidator res)
        {
            if (res == null)
            {
                return(false);
            }

            return(!res.HasError);
        }
Example #2
0
        public FluentValidator Validate(object item)
        {
            var res = new FluentValidator();

            try
            {
                var a = (T)item;
                Validate(res, a);

                return(res);
            }
            catch (Exception ex)
            {
                log.LogError(ex.ToString());

                return(res.AddError(Tran.Instance.Get("UnknownError")));
            }
        }
Example #3
0
 protected abstract void Validate(FluentValidator k, T a);
Example #4
0
        public void Validate(object item, FluentValidator k)
        {
            var a = (T)item;

            Validate(k, a);
        }