Example #1
0
        public async Task <IActionResult> RegisterMember(RegisterMemberModel model)
        {
            var userId = _userManager.GetUserId(User);
            var user   = await _userManager.FindByIdAsync(userId);

            var member = BuildMember(model, user);

            await _memberService.Create(member);

            // return RedirectToAction("Detail", "Member", new { id = member.Id } );
            return(RedirectToAction("Index", "Member"));
        }
 public IActionResult Create([FromBody] MemberEntity model)
 {
     try
     {
         if (model != null)
         {
             var x = _member.Create(model);
             return(Json(x));
         }
         else
         {
             return(Json(model));
         }
     }
     catch (Exception ex)
     {
         return(StatusCode(409, $"{ex.Message}"));
     }
 }