Ejemplo n.º 1
0
        public async Task <IActionResult> PutBirdLog(long id, BirdLog birdLog)
        {
            if (id != birdLog.BirdLogID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <SunTrack> > PostSunTrack(SunTrack tmpSunTrack)
        {
            _context.SunTrack.Add(tmpSunTrack);

            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSunTrack", new { id = tmpSunTrack.Id }, tmpSunTrack));
        }