Esempio n. 1
0
        public async Task <IActionResult> CreatAsync(CreateImageModel model)
        {
            var imgForCreate = _mapper.Map <Image>(model);
            var img          = await _imagesService.CreateAsync(imgForCreate);

            return(CreatedAtAction(nameof(GetAsync), new { id = img.Id, }, _mapper.Map <ImageModel>(img)));
        }
Esempio n. 2
0
        public async Task <ActionResult <ImageDto> > Create([FromForm] UpsertImageBindingModel createImageBm)
        {
            var response = await _imagesService.CreateAsync(Mapper.Map <CreateImageDto>(createImageBm));

            return(Ok(response));
        }