Example #1
0
        // GET api/events/username
        public async Task <IHttpActionResult> GetEventByUser(string username, [FromUri] UserLogin userLogin)
        {
            var user_Login = await _userService.GetUserByUsername(userLogin.Username);

            if (user_Login.Password != userLogin.Password)
            {
                return(Unauthorized());
            }
            var eventByUsername = await _eventServices.GetEventByUserName(username);

            if (eventByUsername == null)
            {
                return(BadRequest("No such event"));
            }
            return(Ok(eventByUsername));
        }