Beispiel #1
0
        public async Task <bool> PostInstrumexts(Instrumexts instrumexts)
        {
            _context.Instrumexts.Add(instrumexts);
            await _context.SaveChangesAsync();

            return(true);
        }
Beispiel #2
0
        public async Task <bool> PutInstrumexts(int id, Instrumexts instrumexts)
        {
            if (id != instrumexts.Id)
            {
                return(false);
            }

            _context.Entry(instrumexts).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InstrumextsExists(id))
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }

            return(true);
        }