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); }
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); }
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); }
public async Task <IQueryable <ImageComment> > RetrieveComments(Guid id) { var commentTable = Configuration["CommentsTable"]; return(await CloudTableService.Retrieve <ImageComment>(id, commentTable)); }
public async Task <IQueryable <Image> > RetrieveImages() { var imagesContainerName = Configuration["ImagesTable"]; return(await CloudTableService.Retrieve <Image>(imagesContainerName)); }