Example #1
0
        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());
        }
Example #2
0
        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));
        }
Example #3
0
 public Task <bool> UpdateVolunteerLog(int id, VolunteerLog log)
 {
     throw new NotImplementedException();
 }
Example #4
0
 public Task <bool> AddVolunteerLog(VolunteerLog logs)
 {
     throw new NotImplementedException();
 }