コード例 #1
0
        public void TestUpdtedEmp()
        {
            var emp = _employee.GetEmpByIdAtBL(20008);

            emp.Department = "AutoDAP";
            _employee.PutEmpAtBL(emp);

            emp.Department = "Autofacets";
            _employee.PutEmpAtBL(emp);

            Assert.AreEqual("Autofacets", emp.Department);
        }
コード例 #2
0
 public IHttpActionResult PutEmployee(EmployeeViewModel emp)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _employee.PutEmpAtBL(emp);
         } catch (Exception)
         {
             throw;
         }
         return(Ok(emp));
     }
     else
     {
         return(BadRequest(ModelState));
     }
 }