public async Task <IActionResult> Create([FromForm] CreateShapeInput input) { var absolutePath = Path.Combine(_webHostEnvironment.WebRootPath, Shape.IMAGE_PATH); await _shapeService.Create(input, absolutePath); return(Ok()); }
public async Task Create(CreateShapeInput input, string imageFolderPath) { var imageName = await Upload.UploadImageAsync(input.Image, imageFolderPath); var shape = new Shape(image: imageName, name: input.Name, status: input.Status, description: input.Description); await _shapeRepo.Create(shape); await _shapeRepo.SaveChangesAsync(); }