public ActionResult<Material> ChangeMaterialCategory(string name, Category category) { var material = _materialService.ChangeMaterialCategory(name, category); if (material != null) { return Ok(material); } return BadRequest("Не удалось найти материал с данным именем"); }
public ActionResult <Material> ChangeMaterialCategory(string name, string category) { if (Categories.Contains(category)) { var material = _materialService.ChangeMaterialCategory(name, category); if (material != null) { return(Ok(material)); } } return(BadRequest()); }
public ActionResult <Material> ChangeMaterialCategory(string name, string category) { if (Enum.IsDefined(typeof(MaterialCategories), category)) { var material = _materialService.ChangeMaterialCategory(name, category); if (material != null) { return(Ok(material)); } } return(BadRequest()); }