Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
Frequently Used Methods
public IActionResult UpdateLikes(int id, int like) { var ent = Service.ByID(id); if (ent == null) { return(BadRequest()); } if (like == 1) { ent.Likes++; } else { if (ent.Likes > 0) { ent.Likes--; } } Service.Update(ent); return(Ok()); }