示例#1
0
        public ActionResult <StaffReadDto> CreateMember(StaffCreateDto staffCreateDto)
        {
            var x = _mapper.Map <Staff>(staffCreateDto);

            _repo.CreateMember(x);
            _repo.SaveChanges();


            var staffReadDto = _mapper.Map <StaffReadDto>(x);

            return(CreatedAtRoute(nameof(GetStaffById), new  { Id = staffReadDto.Id }, staffReadDto));
        }