Beispiel #1
0
        public async Task <ActionResult <VentureSchedule> > PostVentureSchedule(VentureSchedule ventureSchedule)
        {
            _dbContext.VentureSchedule.Add(ventureSchedule);
            await _dbContext.SaveChangesAsync();

            return(CreatedAtAction("GetVentureSchedule", new { key = ventureSchedule.VentureScheduleKey }, ventureSchedule));
        }
Beispiel #2
0
        public async Task <IActionResult> PutVentureSchedule(Guid key, VentureSchedule ventureSchedule)
        {
            if (key != ventureSchedule.VentureScheduleKey)
            {
                return(BadRequest());
            }

            _dbContext.Entry(ventureSchedule).State = EntityState.Modified;

            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VentureScheduleExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }