コード例 #1
0
        // DELETE api/<controller>/5
        public void Delete(int id)
        {
            var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext);


            using (var appClientContext = accessTokenInfo.CreateAppOnlyClientContextForSPHost())
            {
                Utilities.DeleteJsLink(appClientContext);
            }
        }
コード例 #2
0
        public void Post([FromBody] string value)
        {
            var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext);


            using (var appClientContext = accessTokenInfo.CreateAppOnlyClientContextForSPHost())
            {
                Utilities.AddCssAndScripts(appClientContext, this.Request);
                Utilities.AddWebParts(appClientContext);
            }
        }
コード例 #3
0
        public string Get(int id)
        {
            var accessTokenInfo = WebAPIHelper.GetAccessTokenInfo(ControllerContext);
            var ctx             = accessTokenInfo.CreateUserClientContextForSPHost();

            ctx.Load(ctx.Web, w => w.Title);
            ctx.ExecuteQuery();

            return(ctx.Web.Title);

            //return "value";
        }