Exemplo n.º 1
0
        /// <summary>
        /// Index action
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var             xmlPath = HostingEnvironment.MapPath("~/App_Data/Alan.WebApiDoc.Demonstration.XML");
            WebApiQueriable query   = new WebApiQueriable();
            List <TypeMember <MethodMember <CustomParameterMember>, CustomParameterMember> > typeMembers =
                RawMemberNode.Parse <TypeMember <MethodMember <CustomParameterMember>, CustomParameterMember>, MethodMember <CustomParameterMember>, CustomParameterMember>(xmlPath, query);

            return(Json(typeMembers, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public void ReadTest()
        {
            var doc1 = RawMemberNode.Parse(@"C:\Users\Alan\Workspace\Projects\Alan.WebApiDoc\Alan.WebApiDoc\Alan.WebApiDoc.Demonstration\App_Data\Alan.WebApiDoc.Demonstration.XML").ToList();

            //var types = XRawMemberNode.Parse<TypeMember, MethodMember>(@"C:\Users\Alan\Workspace\Projects\Alan.WebApiDoc\Alan.WebApiDoc\Alan.WebApiDoc.Demonstration\App_Data\Alan.WebApiDoc.Demonstration.XML").ToList();
            //var doc1 = XRawMemberNode.Parse(@"C:\Users\Alan\Workspace\Projects\WebApiDoc\Alan.WebApiDoc.Demonstration\App_Data\WebApiDoc.XML").ToList();
            //var doc1 = XRawMemberNode.Parse(@"D:\OpenSource\Alan.WebApiDoc\Alan.WebApiDoc\Alan.WebApiDoc.Demonstration\App_Data\Alan.WebApiDoc.Demonstration.XML");

            System.IO.File.WriteAllText(@"D:\doc.json", JsonConvert.SerializeObject(doc1, Formatting.Indented));
        }
        public ActionResult Index()
        {
            var           xmlPath       = HostingEnvironment.MapPath("~/App_Data/Alan.ApiDocumentation.Demonstration.XML");
            IApiQueryable assemblyQuery = new AssemblyApiQueryable(Assembly.GetExecutingAssembly());
            IApiQueryable apiQuery      = new WebApiQueryable();
            List <TypeMember <MethodMember <CustomParameterMember>, CustomParameterMember> > typeMembers =
                RawMemberNode.Parse <TypeMember <MethodMember <CustomParameterMember>, CustomParameterMember>, MethodMember <CustomParameterMember>, CustomParameterMember>(xmlPath, assemblyQuery, apiQuery)
                .ToList();

            return(Json(typeMembers, JsonRequestBehavior.AllowGet));
        }
 static void RunTest()
 {
     var memebers = RawMemberNode.Parse(@"D:\OpenSource\HsmEdu\HsmEdu.WebApi\App_Data\HsmEdu.WebApi.XML").ToList();
     var json     = Newtonsoft.Json.JsonConvert.SerializeObject(memebers);
 }
Exemplo n.º 5
0
        public static GeneralRawMemberNode Init(RawMemberNode node)
        {
            var model = new GeneralRawMemberNode(node);

            return(node.ToModel <GeneralRawMemberNode>(model));
        }
Exemplo n.º 6
0
 private GeneralRawMemberNode(RawMemberNode node)
 {
     this.node = node;
 }