コード例 #1
0
ファイル: UserController.cs プロジェクト: basae/GeoMoniker
        // PUT api/user/5
        public bool Put([FromBody] User Usr)
        {
            ServiceResponse <User> Response = _userRepository.Update(Usr);

            if (Response.Error)
            {
                throw new HttpResponseException(this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, Response.Message));
            }
            return(true);
        }
コード例 #2
0
        public void UpdateUser()
        {
            var users = new UserTable
            {
                UserId     = 1002,
                FirstName  = "NUNIT",
                LastName   = "NUNIT",
                EmployeeId = 3,
                Deleted    = false
            };

            bool updated = user.Update(users.UserId, users);

            Assert.AreEqual(true, updated);
        }
コード例 #3
0
 public IHttpActionResult UpdateUser(UserTable Users)
 {
     if (ModelState.IsValid)
     {
         try
         {
             bl.Update(Users.UserId, Users);
         }
         catch (Exception)
         {
             return(Ok("Error is occured during updated !"));
         }
         return(Ok("Record is updated Sucessfully !"));
     }
     return(Ok());
 }