コード例 #1
0
        /////////////////////////////////////////////may cause error
        public IActionResult EditMaterial(LinkMaterial k)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("enter the whole data please"));
            }

            return(Ok(k));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }