Beispiel #1
0
        // Return info about the user who sent the request.
        public async Task <IHttpActionResult> GetUserInfo()
        {
            var user = await this.AppUserManager.FindByNameAsync(User.Identity.Name);

            if (user != null)
            {
                var userInfo = new ParticipantDto
                {
                    UserName = user.UserName,
                    ImageUrl = user.PictureId != null ? user.Image.ImageUrl : "/Client/assets/img/signup_male.png",
                    //ImageUrl = user.Images.Count != 0 ? user.Images.FirstOrDefault().ImageUrl : "/Client/assets/img/signup_male.png",
                    Gender      = user.Gender,
                    DateOfBirth = user.DateOfBirth,
                    AboutMe     = user.AboutMe
                };

                return(Ok(userInfo));
            }
            return(NotFound());
        }
Beispiel #2
0
 public bool UpdateParticipant(ParticipantDto participant)
 {
     return(_participantRepository.Update(participant));
 }
Beispiel #3
0
 public bool CreateParticipant(ParticipantDto participant)
 {
     return(_participantRepository.Add(participant));
 }