Exemple #1
0
        public async Task <IHttpActionResult> PutAttended(int id, Attended attended)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != attended.Id)
            {
                return(BadRequest());
            }

            db.Entry(attended).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
 public async Task SaveAsync()
 {
     await _dbContext.SaveChangesAsync();
 }