public async Task <int> Clap(int clapNumber, int postId) { var postClap = await _selahDbContext.PostClaps.Where(clap => clap.PostClapId == postId).FirstOrDefaultAsync(); if (postClap != null) { postClap.Claps += clapNumber; _selahDbContext.Update(postClap); await _selahDbContext.SaveChangesAsync(); return(await GetClaps(postId)); } postClap = new PostClap { PostClapId = postId, Claps = clapNumber }; _selahDbContext.Add(postClap); await _selahDbContext.SaveChangesAsync(); return(await GetClaps(postId)); }