private void PopulateCustomFields(IMember createdMember, IdentityPortalUpdate input) { createdMember.SetValue("firstName", input.Firstname); createdMember.SetValue("lastName", input.Lastname); createdMember.SetValue("dateOfBirth", input.DateOfBirth); createdMember.SetValue("address", input.Address); createdMember.SetValue("passportNumber", input.PassportNumber); }
public IHttpActionResult UpdateMember([FromBody] IdentityPortalUpdate member) { var memberExists = DoesMemberExist(member.Email); if (!memberExists) { return(Ok(new { error = "User does not exists" })); } var existingMember = GetMemberDetails((member.Email)); PopulateCustomFields(existingMember, member); _memberService.Save(existingMember, false); var json = JsonConvert.SerializeObject(ConvertRawMember(existingMember), new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }); return(Ok(new { memberInfo = json })); }