public async Task <IActionResult> PutDepartment(int id, Department department)
        {
            if (id != department.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
 /// <summary>
 /// 更新一筆Entity內容。
 /// </summary>
 /// <param name="entity">要更新的內容</param>
 public void Update(Department entity)
 {
     Context.Entry <Department>(entity).State = EntityState.Modified;
 }
 /// <summary>
 /// 更新一筆Entity內容。
 /// </summary>
 /// <param name="entity">要更新的內容</param>
 public void Update(Employee entity)
 {
     Context.Entry <Employee>(entity).State = EntityState.Modified;
 }