public async Task <bool> AddImage(PhotoBucketModel Data) { if (Data.ImageStream == null) { return(false); } try { bool ResultImage = await AddBlobImage(Data.ImageContainer, Data.ImageID, Data.ImageExtension, Data.ImageStream); if (ResultImage) { return(await AddNewImageData(new AzurePhotoBucket(Data), Data.ImageContainer)); } else { return(false); } } catch (Exception ex) { Console.WriteLine(ex.Message); return(false); } }
public AzurePhotoBucket(PhotoBucketModel Data) { this.Timestamp = DateTime.UtcNow; this.PartitionKey = "PhotoBucket"; this.RowKey = Data.ImageID.ToString(); this.ImageID = Data.ImageID.ToString(); this.ImageExtension = Data.ImageExtension; this.ImageType = Data.ImageType; this.ImageFullName = Data.ImageID + "." + Data.ImageExtension; }