Ejemplo n.º 1
0
        public async Task <IHttpActionResult> UpdateProfile(VMProfile profile)
        {
            // Decode the Claims for get all values
            var identity = (ClaimsIdentity)User.Identity;
            IEnumerable <Claim> claims = identity.Claims;
            var idAccount = Convert.ToInt64(claims.Where(c => c.Type == "idAccount").Single().Value);

            profile.Id = idAccount;
            var result = await accountbusiness.UpdateProfile(profile);

            if (result)
            {
                return(Content(HttpStatusCode.OK, result));
            }
            else
            {
                return(Content(HttpStatusCode.InternalServerError, "Error"));
            }
        }