Skip to content

Instantly share code, notes, and snippets.

@supreettare
Created September 26, 2016 13:21
Show Gist options
  • Select an option

  • Save supreettare/62250b07d35e0aef9c553691553f188f to your computer and use it in GitHub Desktop.

Select an option

Save supreettare/62250b07d35e0aef9c553691553f188f to your computer and use it in GitHub Desktop.
ReportStorageController
public class ReportStorageController : StorageController<Report>
{
[HttpPost]
[Route("tables/Report/{id}/StorageToken")]
public async Task<HttpResponseMessage> PostStorageTokenRequest(string id, StorageTokenRequest value)
{
StorageToken token = await GetStorageTokenAsync(id, value);
return Request.CreateResponse(token);
}
// Get the files associated with this record
[HttpGet]
[Route("tables/Report/{id}/MobileServiceFiles")]
public async Task<HttpResponseMessage> GetFiles(string id)
{
IEnumerable<MobileServiceFile> files = await GetRecordFilesAsync(id);
return Request.CreateResponse(files);
}
[HttpDelete]
[Route("tables/Report/{id}/MobileServiceFiles/{name}")]
public Task Delete(string id, string name)
{
return base.DeleteFileAsync(id, name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment