public async Task <int> AddLike(int id) { if (!await _context.like.Where(b => b.post == id && b.username == User.Identity.Name).AnyAsync()) { Like like = new Like { post = id, username = User.Identity.Name, }; await _context.AddAsync(like); await _context.SaveChangesAsync(); return(await ResolveLikes(id)); } else { return(await ResolveLikes(id)); } }