Produced by Araxis Merge on 2/1/2017 2:56:49 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM\trunk\SDK\SampleCode\CS\ModernAndMobileApps\ModernOdataApp | RequestBuilder.cs | Tue Dec 20 19:51:47 2016 UTC |
| 2 | Wed Feb 1 19:56:49 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 62 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // ======= ========== ========== ========== ========== ========== ========== == | |||||
| 2 | // | |||||
| 3 | // This f ile is par t of the M icrosoft D ynamics CR M SDK Code Samples. | |||||
| 4 | // | |||||
| 5 | // Copyri ght (C) Mi crosoft Co rporation. All righ ts reserve d. | |||||
| 6 | // | |||||
| 7 | // This s ource code is intend ed only as a supplem ent to Mic rosoft | |||||
| 8 | // Develo pment Tool s and/or o nline docu mentation. See thes e other | |||||
| 9 | // materi als for de tailed inf ormation r egarding M icrosoft c ode sample s. | |||||
| 10 | // | |||||
| 11 | // THIS C ODE AND IN FORMATION ARE PROVID ED "AS IS" WITHOUT W ARRANTY OF ANY | |||||
| 12 | // KIND, EITHER EXP RESSED OR IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E | |||||
| 13 | // IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR A | |||||
| 14 | // PARTIC ULAR PURPO SE. | |||||
| 15 | // | |||||
| 16 | // ======= ========== ========== ========== ========== ========== ========== == | |||||
| 17 | ||||||
| 18 | //<snippet ModernOdat aApp2> | |||||
| 19 | using Syst em.Net.Htt p; | |||||
| 20 | using Syst em.Net.Htt p.Headers; | |||||
| 21 | using Syst em.Threadi ng.Tasks; | |||||
| 22 | ||||||
| 23 | namespace ModernOdat aApp | |||||
| 24 | { | |||||
| 25 | public static cl ass HttpRe questBuild er | |||||
| 26 | { | |||||
| 27 | // / <summary > | |||||
| 28 | // / Retrieve entity re cord data from the o rganizatio n web serv ice. | |||||
| 29 | // / </summar y> | |||||
| 30 | // / <param n ame="acces sToken">Th e web serv ice authen tication a ccess toke n.</param> | |||||
| 31 | // / <param n ame="Colum ns">The en tity attri butes to r etrieve.</ param> | |||||
| 32 | // / <param n ame="entit y">The tar get entity for which the data should be retreived. </param> | |||||
| 33 | // / <returns >Response from the w eb service .</returns > | |||||
| 34 | // / <remarks >Builds an OData HTT P request using pass ed paramet ers and se nds the re quest to t he server. </remarks> | |||||
| 35 | pu blic stati c async Ta sk<string> Retrieve( string acc essToken, string[] C olumns, st ring entit y) | |||||
| 36 | { | |||||
| 37 | // Build a list of entity at tributes t o retrieve as a stri ng. | |||||
| 38 | string c olumnsSet = ""; | |||||
| 39 | foreach (string Co lumn in Co lumns) | |||||
| 40 | { | |||||
| 41 | colu mnsSet += "," + Colu mn; | |||||
| 42 | } | |||||
| 43 | ||||||
| 44 | // The U RL for the OData org anization web servic e. | |||||
| 45 | string u rl = Curre ntEnvironm ent.CrmSer viceUrl + "/XRMServi ces/2011/O rganizatio nData.svc/ " + entity + "?$sele ct=" + col umnsSet.Re move(0, 1) + ""; | |||||
| 46 | ||||||
| 47 | // Build and send the HTTP r equest. | |||||
| 48 | HttpClie nt httpCli ent = new HttpClient (); | |||||
| 49 | httpClie nt.Default RequestHea ders.Autho rization = new Authe nticationH eaderValue ("Bearer", accessTok en); | |||||
| 50 | HttpRequ estMessage req = new HttpReque stMessage( HttpMethod .Get, url) ; | |||||
| 51 | req.Meth od = HttpM ethod.Get; | |||||
| 52 | ||||||
| 53 | // Wait for the we b service response. | |||||
| 54 | HttpResp onseMessag e response ; | |||||
| 55 | response = await h ttpClient. SendAsync( req); | |||||
| 56 | var resp onseBodyAs Text = awa it respons e.Content. ReadAsStri ngAsync(); | |||||
| 57 | ||||||
| 58 | return r esponseBod yAsText; | |||||
| 59 | } | |||||
| 60 | } | |||||
| 61 | } | |||||
| 62 | //</snippe tModernOda taApp2> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.