public async Task <IActionResult> Post([FromBody] CreateStationDto createStationDto) { if (createStationDto == null) { return(BadRequest()); } await _stationAppService.Create(createStationDto); return(Ok()); }
public async Task <StationListDto> Create(CreateStationDto input) { //var station = ObjectMapper.Map<User>(input); var station = _mapper.Map <CreateStationDto, Station>(input); _stationsRepository.Add(station); await _unitOfWork.SaveAsync(); var result = _mapper.Map <Station, StationListDto>(station); return(result); }