コード例 #1
0
 public ActionResult<Material> ChangeMaterialCategory(string name, Category category)
 {
     var material = _materialService.ChangeMaterialCategory(name, category);
     if (material != null)
     {
         return Ok(material);
     }
     return BadRequest("Не удалось найти материал с данным именем");
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 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());
 }