示例#1
0
        public async Task <ActionResult> Put(Material _Material)
        {
            var newsite = new Models.Material()
            {
                Id          = _Material.Id,
                Code        = _Material.Code,
                Description = _Material.Description
            };

            db.Entry(newsite).State = EntityState.Modified;
            await db.SaveChangesAsync();

            return(NoContent());
        }
示例#2
0
        public async Task <ActionResult> Post(Material _Material)
        {
            var newsite = new Models.Material()
            {
                Id          = _Material.Id,
                Code        = _Material.Code,
                Description = _Material.Description
            };

            db.Materials.Add(newsite);
            await db.SaveChangesAsync();

            return(new CreatedAtRouteResult("GetMaterial", new { id = _Material.Id }, newsite));
        }