示例#1
0
 public async Task <IActionResult> Put([FromBody] ServiceType serviceType, bool rollback = false)
 {
     try
     {
         return(Ok(await ServiceTypeManager.Update(serviceType, rollback)));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
示例#2
0
        public void UpdateTest()
        {
            var         task        = ServiceTypeManager.Load();
            ServiceType serviceType = task.Result.FirstOrDefault();

            task.Wait();

            serviceType.CostPerSQFT = 0.003M;

            var task2  = ServiceTypeManager.Update(serviceType, true);
            int result = task2.Result;

            task2.Wait();

            Assert.IsTrue(result > 0);
        }