public ActionResult Create(DmsanPham model)
        {
            model.Id = Guid.NewGuid();
            var sanpham = model.CopyAs <DmsanPham>();

            _context.DmsanPham.Add(sanpham);
            _context.SaveChanges();
            return(Ok(model));
        }
        public ActionResult Update(DmsanPham model)
        {
            //var data = _context.DmsanPham.Find(model.Id);
            //if (String.IsNullOrEmpty(data.ImageUrl))
            //{
            //    //data.ImageUrl = model.ImageUrl;
            //}
            //else
            //{
            //    data.ImageUrl = model.ImageUrl;
            //}
            var update = model.CopyAs <DmsanPham>();

            _context.Entry(update).State = EntityState.Modified;
            _context.SaveChanges();
            return(NoContent());
        }