public HttpResponseMessage GetContainers(string prefix) { IEnumerable <CloudBlobContainer> containers; if (!string.IsNullOrEmpty(prefix)) { prefix = prefix.TrimStart('/', '\\').Replace('\\', '/'); containers = this.cloudBlobClient.ListContainers(prefix); } else { containers = this.cloudBlobClient.ListContainers(); } var result = new SasCloudBlobContainerListResponse { Containers = containers .Where(c => true) .Select(c => c.ToModel()) .ToArray() }; return(Request.CreateResponse <SasCloudBlobContainerListResponse>(HttpStatusCode.OK, result)); }
public HttpResponseMessage GetContainers(string prefix) { IEnumerable<CloudBlobContainer> containers; if (!string.IsNullOrEmpty(prefix)) { prefix = prefix.TrimStart('/', '\\').Replace('\\', '/'); containers = this.cloudBlobClient.ListContainers(prefix); } else { containers = this.cloudBlobClient.ListContainers(); } var result = new SasCloudBlobContainerListResponse { Containers = containers .Where(c => true) .Select(c => c.ToModel()) .ToArray() }; return Request.CreateResponse<SasCloudBlobContainerListResponse>(HttpStatusCode.OK, result); }