コード例 #1
0
        public Response <List <Resource> > LoadForRole(string appId, string firstId)
        {
            var result = new Response <List <Resource> > ();

            try {
                result.Result = _app.LoadForRole(appId, firstId).ToList();
            } catch (Exception e) {
                result.Code    = 500;
                result.Message = e.InnerException?.Message ?? e.Message;
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// 加载角色资源
        /// </summary>
        /// <param name="appId">应用ID</param>
        /// <param name="firstId">角色ID</param>
        public string LoadForRole(string appId, string firstId)
        {
            try
            {
                var result = new Response <List <string> >
                {
                    Result = _app.LoadForRole(appId, firstId).Select(u => u.Id).ToList()
                };
                return(JsonHelper.Instance.Serialize(result));
            }
            catch (Exception e)
            {
                Result.Code    = 500;
                Result.Message = e.InnerException?.Message ?? e.Message;
            }

            return(JsonHelper.Instance.Serialize(Result));
        }