public CreateProductRequestToProductMapper(ICreatePropertyRequestToPropertyMapper propertyMapper, ICreateLaunchRequestToLaunchMapper launchMapper, ICreatePriceRequestToPriceMapper priceMapper) { _propertyMapper = propertyMapper; _launchMapper = launchMapper; _priceMapper = priceMapper; }
public async Task <IActionResult> AddOrUpdatePropertyAsync(string key, [FromBody] CreatePropertyRequest request, [FromServices] ICreatePropertyRequestToPropertyMapper mapper) { if (ModelState.IsValid) { var property = mapper.Map(request); await _service.AddOrUpdateProductPropertyAsync(property, key); var link = _urlHelper.Link(GetPropertiesByProductRouteName, new { controller = "properties", key = key }); return(Created(link, link)); } return(BadRequest()); }