public Like AddLike(Like like) { var client = _storageAccount.CreateCloudTableClient(); var table = client.GetTableReference(TableStorageConstants.LikeTableKey); var insertOperation = TableOperation.Insert(like); table.Execute(insertOperation); return like; }
public ActionResult Like(string videoId) { bool alreadyLiked; _videoRepository.LikesCount(videoId, IdentityHelper.GetUserToken(), out alreadyLiked); if (!alreadyLiked) { var like = new Like(videoId, IdentityHelper.GetUserToken()); _videoRepository.AddLike(like); } return RedirectToAction("Details", new { videoId = videoId }); }