I have Image Name in Database without extension like below
Database Entry --------------->
Blob
1_1 -----------------------> 1_1.jpg
1_2 -----------------------> 1_2.png
1_3 -----------------------> 1_3.jpg
1_4 -----------------------> 1_4.png
In database I have no Image Extension. I want to find particular image from blob.
below is my code it compare with every image if 1-1 and 1-1(blob remove extension from 1-1.jpg)
match then return blob url. So it is time consuming.
I want to return image without for loop return using Linq Query with comapare condition.
so please give me linq query regarding this issue.
Plase help me for performance purpose.
Below is my code just for help.
Thanks.
public static string searchImageFromBlob(string intBLOBID, string strDataConnectionString, string strContainerName)
{
< Microsoft.WindowsAzure.StorageClient.CloudBlobClient _BlobClient = null;
var storageAccount = Microsoft.WindowsAzure.CloudStorageAccount.FromConfigurationSetting(strDataConnectionString);
_BlobClient = storageAccount.CreateCloudBlobClient();
Microsoft.WindowsAzure.StorageClient.CloudBlobContainer container = _BlobClient.GetContainerReference(strContainerName);
if (container != null)
{
foreach (var properties in container.ListBlobs())
{
var blob = properties.Container.GetBlobReference(properties.Uri.ToString());
if (intBLOBID == RemoveFileExtension(blob.Uri.Segments[2]))
return blob.Uri.ToString();
}
}
return "";
}