public Task <RestDirectoryInfo> GetInfoAsync()
        {
            IEnumerable <RestResourceInfo> restResourceInfos = _directorySource.GetCollectionNames().Select(name => new RestResourceInfo(name, ResourceType.Collection));
            RestDirectoryInfo directoryInfo = new RestDirectoryInfo(restResourceInfos);

            return(Task.FromResult(directoryInfo));
        }
Example #2
0
        public async Task <Options> OptionsAsync()
        {
            RestDirectoryInfo info = await Directory.GetInfoAsync();

            return(new Options
            {
                Description = "A directory containing collections",
                AllowedMethods = new[]
                {
                    new OptionsMethod("GET", "Lists the available collections in this directory")
                },
                SubResources = info.Resources
            });
        }
Example #3
0
 public DirectoryBody(RestDirectoryInfo directory, Func <string, string> pathNameSwitcher)
 {
     _pathNameSwitcher = pathNameSwitcher;
     Resources         = directory.Resources.Select(GetOutputData);
 }
Example #4
0
        public async Task <ResourceBody> GetAsync(IRestCollectionQuery query)
        {
            RestDirectoryInfo directory = await Directory.GetInfoAsync();

            return(new DirectoryBody(directory, Context.Services.NameSwitcher.ConvertCodedToDefault));
        }