コード例 #1
0
        public bool CheckEventPassword(CheckEventPasswordDto dto)
        {
            var eventToCheck = _context.Events
                               .Single(e => e.EventId == dto.EventId);

            if (eventToCheck.AudienceKey == dto.AudienceKey)
            {
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public IActionResult CheckEventPassword([FromBody] CheckEventPasswordDto dto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var isPasswordCorrect = _eventService.CheckEventPassword(dto);

            if (isPasswordCorrect)
            {
                return(Ok());
            }

            return(Unauthorized());
        }
コード例 #3
0
 public bool CheckEventPassword(CheckEventPasswordDto dto)
 {
     return(_eventRepo.CheckEventPassword(dto));
 }