/////////////////////////////////////////////may cause error public IActionResult EditMaterial(LinkMaterial k) { if (!ModelState.IsValid) { return(BadRequest("enter the whole data please")); } return(Ok(k)); }
public IEnumerable <LinkMaterial> AddMaterial(LinkMaterial NewMaterial) { var material = db.LinkMaterials.FromSqlRaw("EXEC dbo.usp_LinkMaterials_Insert {0},{1}" , NewMaterial.LinkMaterialName , NewMaterial.URL ) .ToList <LinkMaterial>(); return(material); }
public IEnumerable <LinkMaterial> EditMaterial(LinkMaterial EditMaterial) { var material = db.LinkMaterials.FromSqlRaw("EXEC dbo.usp_LinkMaterials_Insert {0},{1},{2}" , EditMaterial.LinkMaterialId , EditMaterial.LinkMaterialName , EditMaterial.URL ) .ToList <LinkMaterial>(); return(material); }