Exemplo n.º 1
0
        public async Task <Image> RetrieveImage(Guid id)
        {
            var tableName = Configuration["ImagesTable"];

            var image = await CloudTableService.RetrieveSingle <Image>(id, tableName);

            image.Comments = await RetrieveComments(id);

            return(image);
        }
Exemplo n.º 2
0
        public async Task UploadImageInformationToTable(IFormFile file, Guid imageId, Uri blobUri)
        {
            var tableName = Configuration["ImagesTable"];

            var fileName = Path.GetFileName(file.FileName);

            var entity = new Image(imageId)
            {
                Name = fileName, Uri = blobUri.AbsoluteUri
            };

            await CloudTableService.Insert(entity, tableName);
        }
Exemplo n.º 3
0
        public async Task AddComment(Guid imageId, string comment, double score, string phrases)
        {
            var commentTable = Configuration["CommentsTable"];

            var imageComment = new ImageComment
            {
                PartitionKey = imageId.ToString(),
                Comment      = comment,
                ImageId      = imageId,
                Phrases      = phrases,
                Score        = score
            };

            await CloudTableService.Insert(imageComment, commentTable);
        }
Exemplo n.º 4
0
        public async Task <IQueryable <ImageComment> > RetrieveComments(Guid id)
        {
            var commentTable = Configuration["CommentsTable"];

            return(await CloudTableService.Retrieve <ImageComment>(id, commentTable));
        }
Exemplo n.º 5
0
        public async Task <IQueryable <Image> > RetrieveImages()
        {
            var imagesContainerName = Configuration["ImagesTable"];

            return(await CloudTableService.Retrieve <Image>(imagesContainerName));
        }