public async Task <bool> UpdateReference(string accessToken, Reference reference)
        {
            StringBuilder requestUri = new StringBuilder()
                                       .Append(SiteUrl)
                                       .Append("/_api/web/lists/getbyTitle('")
                                       .Append(ReferencesListName)
                                       .Append("')/getItemByStringId('")
                                       .Append(reference.Id.ToString())
                                       .Append("')");

            XElement entry = reference.ToXElement();

            StringContent       requestContent = new StringContent(entry.ToString());
            HttpResponseMessage response       = await Patch(requestUri.ToString(), accessToken, reference.__eTag, requestContent);

            return(response.IsSuccessStatusCode);
        }
        public async Task<Reference> CreateReference(string accessToken, Reference reference)
        {
            StringBuilder requestUri = new StringBuilder()
                 .Append(SiteUrl)
                 .Append("/_api/web/lists/getbyTitle('")
                 .Append(ReferencesListName)
                 .Append("')/items");

            if (reference.Title == null || reference.Title.Length == 0)
            {
                reference.Title = await GetTitleFromLink(reference.Url);
            }

            XElement entry = reference.ToXElement();

            StringContent requestContent = new StringContent(entry.ToString());
            HttpResponseMessage response = await Post(requestUri.ToString(), accessToken, requestContent);
            string responseString = await response.Content.ReadAsStringAsync();

            return XElement.Parse(responseString).ToReference();

        }
        public async Task <Reference> CreateReference(string accessToken, Reference reference)
        {
            StringBuilder requestUri = new StringBuilder()
                                       .Append(SiteUrl)
                                       .Append("/_api/web/lists/getbyTitle('")
                                       .Append(ReferencesListName)
                                       .Append("')/items");

            if (reference.Title == null || reference.Title.Length == 0)
            {
                reference.Title = await GetTitleFromLink(reference.Url);
            }

            XElement entry = reference.ToXElement();

            StringContent       requestContent = new StringContent(entry.ToString());
            HttpResponseMessage response       = await Post(requestUri.ToString(), accessToken, requestContent);

            string responseString = await response.Content.ReadAsStringAsync();

            return(XElement.Parse(responseString).ToReference());
        }
        public async Task<bool> UpdateReference(string accessToken, Reference reference)
        {
            StringBuilder requestUri = new StringBuilder()
                .Append(SiteUrl)
                .Append("/_api/web/lists/getbyTitle('")
                .Append(ReferencesListName)
                .Append("')/getItemByStringId('")
                .Append(reference.Id.ToString())
                .Append("')");

            XElement entry = reference.ToXElement();

            StringContent requestContent = new StringContent(entry.ToString());
            HttpResponseMessage response = await Patch(requestUri.ToString(), accessToken, reference.__eTag, requestContent);
            return response.IsSuccessStatusCode;

        }