public async Task <string> CreateAsync(TempCloudImage newCloudImage)
        {
            await this.Repository.AddAsync(newCloudImage);

            await this.Repository.SaveChangesAsync();

            return(newCloudImage.Id);
        }
Exemplo n.º 2
0
        private async Task <bool> SaveThumbnailImage(ImageInfoParams imageInfoParam)
        {
            StoreFileInfo remoteImage = await this.GenerateThumbnailImage(imageInfoParam.ImagePath);

            if (!remoteImage.BoolResult)
            {
                return(false);
            }

            TempCloudImage newCloudImage = new TempCloudImage()
            {
                ImageId   = imageInfoParam.ImageId,
                FileId    = remoteImage.FileId,
                ImageUrl  = remoteImage.FileAddress,
                ImageType = (int)ImageType.Thumbnail,
            };

            await this.tempCloudImage.CreateAsync(newCloudImage);

            return(true);
        }