public async Task <ElementDto> CreateElementOnMapAsync(CreateElementInput input) { var map = await _mapRepository.FirstOrDefaultAsync(m => m.Id == input.MapId); if (map == null) { throw new BaseException($"Map[{input.MapId}] not found!"); } var element = input.MapTo <Element>(); element.UserId = map.UserId; element = await _elementService.CreateAsync(element); return(element.MapTo <ElementDto>()); }