Пример #1
0
        public async Task <IActionResult> PutMadbestillings(int id, JeudanMadbestilling.Models.Madbestillings madbestillings)
        {
            if (id != madbestillings.MadbestillingId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Пример #2
0
        public void Save(Madbestillings m)
        {
            if (m.MadbestillingId == 0)
            {
                _context.Madbestillings.Add(m);
            }
            else
            {
                _context.Madbestillings.Update(m);
            }

            _context.SaveChanges();
        }
Пример #3
0
        public async Task <ActionResult <JeudanMadbestilling.Models.Madbestillings> > PostMadbestillings(JeudanMadbestilling.Models.Madbestillings madbestillings)
        {
            _context.Madbestillings.Add(madbestillings);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMadbestillings", new { id = madbestillings.MadbestillingId }, madbestillings));
        }