コード例 #1
0
        public async Task <HttpResponseMessage> Put(GetViewModel viewModel)
        {
            var user = UserManager.FindById(User.Identity.GetUserId());

            user.DisplayName = viewModel.DisplayName;
            user.Email       = viewModel.Email;

            await UserManager.UpdateAsync(user);

            return(Request.CreateResponse(HttpStatusCode.NoContent));
        }
コード例 #2
0
ファイル: MeController.cs プロジェクト: intoccabil/satellizer
        public async Task<HttpResponseMessage> Put(GetViewModel viewModel)
        {
            var user = UserManager.FindById(User.Identity.GetUserId());

            user.DisplayName = viewModel.DisplayName;
            user.Email = viewModel.Email;

            await UserManager.UpdateAsync(user);

            return Request.CreateResponse(HttpStatusCode.NoContent);
        }
コード例 #3
0
ファイル: MeController.cs プロジェクト: intoccabil/satellizer
        // GET api/Me
        public HttpResponseMessage Get()
        {
            var result = new GetViewModel();

            var user = UserManager.FindById(User.Identity.GetUserId());

            result.DisplayName = user.DisplayName;
            result.Picture = user.Picture;
            result.Id = user.Id;
            result.Email = user.Email;

            var logins = user.Logins;
            foreach (var login in logins)
            {
                if (login.LoginProvider == "Google")
                {
                    result.Google = login.ProviderKey;
                }
            }

            return Request.CreateResponse(HttpStatusCode.OK, result);
        }
コード例 #4
0
        // GET api/Me
        public HttpResponseMessage Get()
        {
            var result = new GetViewModel();

            var user = UserManager.FindById(User.Identity.GetUserId());

            result.DisplayName = user.DisplayName;
            result.Picture     = user.Picture;
            result.Id          = user.Id;
            result.Email       = user.Email;

            var logins = user.Logins;

            foreach (var login in logins)
            {
                if (login.LoginProvider == "Google")
                {
                    result.Google = login.ProviderKey;
                }
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }