public async Task <IActionResult> PutVolunteerLog([FromRoute] int id, [FromBody] VolunteerLog volunteerLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != volunteerLog.Id) { return(BadRequest()); } _context.Entry(volunteerLog).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VolunteerLogExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostVolunteerLog([FromBody] VolunteerLog volunteerLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.VolunteerLog.Add(volunteerLog); await _context.SaveChangesAsync(); return(CreatedAtAction("GetVolunteerLog", new { id = volunteerLog.Id }, volunteerLog)); }
public Task <bool> UpdateVolunteerLog(int id, VolunteerLog log) { throw new NotImplementedException(); }
public Task <bool> AddVolunteerLog(VolunteerLog logs) { throw new NotImplementedException(); }