public virtual void Like(int eventId, string userId) { if (!_likeRepository.Exists(new Like() { UserId = userId, EventId = eventId })) { _likeRepository.Like(new Like() { UserId = userId, EventId = eventId }); } }
public async Task <ActionResult <LikeDto> > Like([FromBody] LikeDto dto) { return(Ok(await _repository.Like(dto))); }
public ActionResult <LikeDto> Like([FromBody] LikeDto dto) { return(Ok(_repository.Like(dto))); }