Ejemplo n.º 1
0
        public async Task <IActionResult> PutStrategyByCountryByRegion(int id,
                                                                       StrategyByCountryByRegion strategyByCountryByRegion)
        {
            if (id != strategyByCountryByRegion.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <StrategyByCountryByRegion> > PostStrategyByCountryByRegion(
            StrategyByCountryByRegion strategyByCountryByRegion)
        {
            _context.mStrategyByCountryByRegion.Add(strategyByCountryByRegion);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetStrategyByCountryByRegion", new { id = strategyByCountryByRegion.Id },
                                   strategyByCountryByRegion));
        }