private static void GetMetadataRequestHeaderSetter(ODataClientRequestMessage requestMessage, string accessToken)
        {
            requestMessage.SetHeader("Accept", ConfigurationManager.AppSettings["Ida:ODataMetadataFormat"]);
            ODataServiceVersionSetter(requestMessage);

            if (accessToken != null)
            {
                requestMessage.SetHeader("Authorization", "Bearer " + accessToken);
            }
        }
        public static IEdmModel GetMetadata(string uri)
        {
            var requestMessage = new ODataClientRequestMessage(new Uri(uri), ODataConstants.MethodGet);

            GetMetadataRequestHeaderSetter(requestMessage, AuthUtil.Instance.AccessToken);

            using (var messageReader = new ODataMessageReader(requestMessage.GetResponse()))
            {
                return(messageReader.ReadMetadataDocument());
            }
        }
 // Private method
 private static void ODataServiceVersionSetter(ODataClientRequestMessage requestMessage)
 {
     requestMessage.SetHeader("DataServiceVersion", ConfigurationManager.AppSettings["Ida:ODataVersion"]);
     requestMessage.SetHeader("MaxDataServiceVersion", ConfigurationManager.AppSettings["Ida:ODataMaxVersion"]);
 }
 public static void DeleteEntryRequestHeaderSetter(ODataClientRequestMessage requestMessage, string accessToken)
 {
     ODataCRUDHeaderSetter(requestMessage, accessToken);
 }
 public static void UpdateEntryRequestHeaderSetter(ODataClientRequestMessage requestMessage, string accessToken)
 {
     ODataCRUDHeaderSetter(requestMessage, accessToken);
     requestMessage.SetHeader("ContentType", ConfigurationManager.AppSettings["Ida:ODataContentType"]);
 }
 public static void GetFeedOrEntryRequsetHeaderSetter(ODataClientRequestMessage requestMessage, string accessToken)
 {
     ODataCRUDHeaderSetter(requestMessage, accessToken);
 }