예제 #1
0
        public IActionResult GetAllFunction()
        {
            var function           = _service.GetAllFunction();
            List <FunctionDto> Dto = new List <FunctionDto>();

            foreach (var item in function)
            {
                FunctionDto Dtos = _mapper.Map <FunctionDto>(item);
                Dto.Add(Dtos);
            }
            return(Ok(Dto));
        }
예제 #2
0
        ///// <summary>
        ///// 根据名称查找对象(自定义接口使用范例)
        ///// </summary>
        //public List<FunctionInfo> FindByName(string name)
        //{
        //    List<FunctionInfo> result = new List<FunctionInfo>();

        //    IFunctionService service = CreateSubClient();
        //    ICommunicationObject comm = service as ICommunicationObject;
        //    comm.Using(client =>
        //    {
        //        result = service.FindByName(name);
        //    });

        //    return result;
        //}


        public List <FunctionInfo> GetAllFunction(string systemType)
        {
            List <FunctionInfo> result = new List <FunctionInfo>();

            IFunctionService     service = CreateSubClient();
            ICommunicationObject comm    = service as ICommunicationObject;

            comm.Using(client =>
            {
                result = service.GetAllFunction(systemType);
            });

            return(result);
        }
예제 #3
0
        public async Task <IActionResult> Index()
        {
            var rs = await _functionService.GetAllFunction();

            if (rs != null)
            {
                return(new OkObjectResult(new
                {
                    statusCode = HttpStatusCode.OK,
                    Message = "Success",
                    data = rs
                }));
            }
            else
            {
                return(new OkObjectResult(new
                {
                    statusCode = HttpStatusCode.BadRequest,
                    Message = "Get All Function Faild",
                    data = rs
                }));
            }
        }
예제 #4
0
        public IActionResult GetAll()
        {
            var rs = _functionService.GetAllFunction();

            return(new OkObjectResult(rs));
        }