Exemple #1
0
        public async Task <int> AddParent(ParentAddDTO parentAddDTO)
        {
            var parent = _mapper.Map <ParentAddDTO, Parent>(parentAddDTO);
            await _unitOfWork.Parents.AddAsync(parent);

            return(await _unitOfWork.SaveAsync());
        }
        public async Task <ActionResult <string> > AddParent(ParentAddDTO parentAddDTO)
        {
            var result = await _parentService.AddParent(parentAddDTO);

            return(result > 0 ? StatusCode(StatusCodes.Status201Created) : BadRequest());
        }