Exemplo n.º 1
0
        public IHttpActionResult PutAccount(string id, AccountDTO account)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != account.username)
            {
                return(BadRequest());
            }


            try
            {
                bizAccount.updateAccount(account);
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AccountExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }