public async Task <IActionResult> PutPlace(uint id, Place place)
        {
            if (id != place.PlaceID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <ActionResult <Map> > PostMap(Map map)
        {
            _context.Maps.Add(map);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetMap), new { id = map.Id }, map));
        }
Esempio n. 3
0
 public void CommitAsync()
 {
     dataContext.SaveChangesAsync();
 }