public async Task <IActionResult> Updatesource(long id, [FromBody] DemoContentsModel request)
        {
            var ctn = DemoContentsModelsourceService.update(id, request);

            if (ctn == null)
            {
                return(NotFound("Source of Content wasn't found"));
            }

            return(Ok(ctn));
        }
Example #2
0
        public DemoContentsModel update(long id, DemoContentsModel updaterequest)
        {
            var found = _context.DemoContentsModel.Find(id);

            if (found != null)
            {
                found.title = updaterequest.title;
                found.src   = updaterequest.src;
                _context.DemoContentsModel.Update(found);
                _context.SaveChanges();
                return(found);
            }
            return(null);
        }