public async Task <ActionResult <ProductType> > AddProductType([FromBody] AddProductTypeCommand productType) { int num = await _mediator.Send(productType); if (num == 0) { return(BadRequest()); } return(CreatedAtAction(nameof(GetProductTypeByNameAndShopId), new { name = productType.TypeName, shopId = productType.ShopId }, productType)); }
public void Create(AddProductTypeCommand newProductType) { var repo = new ProductTypeRepository(); repo.AddProductType(newProductType); }