コード例 #1
0
        public IActionResult Update([FromBody] CrudViewModel <BoughtoutInstrument> payload)
        {
            BoughtoutInstrument BoughtoutInstrumentType = payload.value;

            _context.BoughtoutInstrument.Update(BoughtoutInstrumentType);
            _context.SaveChanges();
            return(Ok(BoughtoutInstrumentType));
        }
コード例 #2
0
        public IActionResult Remove([FromBody] CrudViewModel <BoughtoutInstrument> payload)
        {
            BoughtoutInstrument BoughtoutInstrumentType = _context.BoughtoutInstrument
                                                          .Where(x => x.boughtoutid == (int)payload.key)
                                                          .FirstOrDefault();

            _context.BoughtoutInstrument.Remove(BoughtoutInstrumentType);
            _context.SaveChanges();
            return(Ok(BoughtoutInstrumentType));
        }