public ActionResult Get(string fullName = null, string formatterName = null) { var data = _fileSystemService.GetAllFileSystemObject(fullName); var json = _fileSystemService.ToJson(data, FormatterFactory.CreateInstance(formatterName)); return(Ok(json)); }
public object ToJson( IEnumerable <FileSystemObject> objs, IFileSystemFormatter fileSystemFormatter = null) { fileSystemFormatter = fileSystemFormatter ?? FormatterFactory.CreateInstance(); return(fileSystemFormatter.ToJson( objs)); }