Exemple #1
0
        public async Task <ActionResult <MpricingLevel> > PostMpricingLevel(MpricingLevel mpricingLevel)
        {
            _context.MpricingLevel.Add(mpricingLevel);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMpricingLevel", new { id = mpricingLevel.Id }, mpricingLevel));
        }
Exemple #2
0
        public async Task <IActionResult> PutMpricingLevel(int id, MpricingLevel mpricingLevel)
        {
            if (id != mpricingLevel.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }