예제 #1
0
        public ActionResult <MemberReadDto> CreateMember(MemberCreateDto memberCreateDto)
        {
            var memberModel = _mapper.Map <Member>(memberCreateDto);

            _repository.CreateMember(memberModel);
            _repository.SaveChanges();

            var memberReadDto = _mapper.Map <MemberReadDto>(memberModel);

            return(CreatedAtRoute(nameof(GetFamilyMemberById), new { Id = memberReadDto.Id }, memberReadDto));
        }