Exemplo n.º 1
0
 private void StoreBlobInfoInDB(ImageRequest imageRequest, string newBlobUri)
 {
     using (var db = new PictureContext())
     {
         db.Pictures.Add(new ImageStore
         {
             BlobURL = newBlobUri,
             Extension = imageRequest.Extension,
             SearchTermString = imageRequest.GetSearchTermsDisplay,
             Index = imageRequest.Index
         });
         db.SaveChanges();
     }
 }
Exemplo n.º 2
0
        private string CheckIfInBlob(ImageRequest imageRequest)
        {
            using (var db = new PictureContext())
            {
                ImageStore image = db.Pictures.Where(i =>
                    i.Extension == imageRequest.Extension
                    && i.SearchTermString == imageRequest.GetSearchTermsDisplay
                    && i.Index == imageRequest.Index
                    ).FirstOrDefault();

                if (image != null)
                    return image.BlobURL;
            }

            return null;
        }