Example #1
0
        public async Task <ActionResult <InstituteDto> > CreateInstitute(InstituteAddDto institute)
        {
            var entity = _mapper.Map <Institute>(institute);

            _instituteRepository.AddInstitute(entity);
            await _instituteRepository.SaveAsync();

            var returnDto = _mapper.Map <InstituteDto>(entity);

            return(CreatedAtRoute(nameof(GetInstitute), new { instituteId = returnDto.Id }, returnDto));
        }