Beispiel #1
0
 public IActionResult AddUser(User user)
 {
     try
     {
         var result = _userRepository.AddUser(user);
         return(ToJson(result?HttpResult.Success:HttpResult.Fail, message: result?"添加成功":"添加失败"));
     }
     catch (Exception exc)
     {
         return(new JsonResult(new { result = 0, message = exc.Message }, new Newtonsoft.Json.JsonSerializerSettings()
         {
             ContractResolver = new LowercaseContractResolver()
         }));
     }
 }
 public int AddUser(User user)
 {
     return(_user.AddUser(user));
 }