예제 #1
0
        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());
        }
예제 #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));
        }
예제 #3
0
 public void CommitAsync()
 {
     dataContext.SaveChangesAsync();
 }