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)); }
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 }); }
public DirectoryBody(RestDirectoryInfo directory, Func <string, string> pathNameSwitcher) { _pathNameSwitcher = pathNameSwitcher; Resources = directory.Resources.Select(GetOutputData); }
public async Task <ResourceBody> GetAsync(IRestCollectionQuery query) { RestDirectoryInfo directory = await Directory.GetInfoAsync(); return(new DirectoryBody(directory, Context.Services.NameSwitcher.ConvertCodedToDefault)); }