Example #1
0
        public static UnitOfWorkResult ErrResult(string message = "")
        {
            var res = new UnitOfWorkResult
            {
                IsSuccess = false,
            };

            if (!string.IsNullOrEmpty(message))
            {
                res.AddMessage(message);
            }
            return(res);
        }
Example #2
0
        /// <summary>
        /// 仅当无需执行持久化操作时可以调用
        /// </summary>
        /// <returns></returns>
        public static UnitOfWorkResult SuccessResult(string message = "")
        {
            var res = new UnitOfWorkResult
            {
                IsSuccess   = true,
                UnitOfWorks = IoC.Resolve <IContext>().Local.UnitOfWorks
            };

            if (!string.IsNullOrEmpty(message))
            {
                res.AddMessage(message);
            }
            return(res);
        }