Exemple #1
0
        private static FileManagerResource Discover(string path, string module)
        {
            var resource = FileManagerResource.Get(path, "*.xml");

            resource = FileManagerResource.NormalizePath(path, resource);
            return(Normalize(resource, module));
        }
        public ActionResult GetResources()
        {
            string path = $"~/Tenants/{this.Tenant}/";

            path = HostingEnvironment.MapPath(path);

            if (path == null || !Directory.Exists(path))
            {
                return(this.Failed("Path not found", HttpStatusCode.NotFound));
            }

            var resource = FileManagerResource.Get(path);

            resource = FileManagerResource.NormalizePath(path, resource);

            string json = JsonConvert.SerializeObject(resource, Formatting.None,
                                                      new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            });

            return(this.Content(json, "application/json"));
        }