public IHttpActionResult Get(int userId) { string name = _identityService.CurrentUser; var userModel = TheModelFactory.CreateUser(TheRepository.GetUserByUserId(userId)); if (userModel.UserName != name) { return(Unauthorized()); } else { return(Ok((TheRepository.GetCertificationForUser(userId).Select(cu => TheModelFactory.GetCertificateInfo(cu))))); } }