Produced by Araxis Merge on 2/1/2017 2:56:29 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\Client\SOAPLogger\SOAPLogger | SoapLoggerOrganizationService.cs | Tue Dec 20 19:51:45 2016 UTC |
| 2 | Wed Feb 1 19:56:29 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 683 |
| 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 n-line doc umentation . See the se 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 | using Syst em; | |||||
| 18 | using Syst em.CodeDom ; | |||||
| 19 | using Syst em.Collect ions.Objec tModel; | |||||
| 20 | using Syst em.Diagnos tics.CodeA nalysis; | |||||
| 21 | using Syst em.Globali zation; | |||||
| 22 | using Syst em.IO; | |||||
| 23 | using Syst em.Runtime .Serializa tion; | |||||
| 24 | using Syst em.Service Model; | |||||
| 25 | using Syst em.Xml; | |||||
| 26 | ||||||
| 27 | using Micr osoft.Xrm. Sdk; | |||||
| 28 | using Micr osoft.Xrm. Sdk.Query; | |||||
| 29 | ||||||
| 30 | ||||||
| 31 | namespace Microsoft. Crm.Sdk.Sa mples | |||||
| 32 | { | |||||
| 33 | pu blic seale d class So apLoggerOr ganization Service : IOrganizat ionService | |||||
| 34 | { | |||||
| 35 | priv ate readon ly Uri Roo tServiceUr i; | |||||
| 36 | priv ate readon ly IOrgani zationServ ice InnerS ervice; | |||||
| 37 | priv ate readon ly TextWri ter Output Writer; | |||||
| 38 | ||||||
| 39 | publ ic SoapLog gerOrganiz ationServi ce(Uri roo tServiceUr i, IOrgani zationServ ice servic e) | |||||
| 40 | : this (rootServi ceUri, ser vice, Cons ole.Out) | |||||
| 41 | { | |||||
| 42 | } | |||||
| 43 | ||||||
| 44 | publ ic SoapLog gerOrganiz ationServi ce(Uri roo tServiceUr i, IOrgani zationServ ice servic e, TextWri ter output Writer) | |||||
| 45 | { | |||||
| 46 | if (nu ll == root ServiceUri ) | |||||
| 47 | { | |||||
| 48 | throw ne w Argument NullExcept ion("rootS erviceUri" ); | |||||
| 49 | } | |||||
| 50 | else i f (null == service) | |||||
| 51 | { | |||||
| 52 | throw ne w Argument NullExcept ion("servi ce"); | |||||
| 53 | } | |||||
| 54 | else i f (null == outputWri ter) | |||||
| 55 | { | |||||
| 56 | throw ne w Argument NullExcept ion("outpu tWriter"); | |||||
| 57 | } | |||||
| 58 | ||||||
| 59 | this.R ootService Uri = root ServiceUri ; | |||||
| 60 | this.I nnerServic e = servic e; | |||||
| 61 | this.O utputWrite r = output Writer; | |||||
| 62 | } | |||||
| 63 | ||||||
| 64 | #reg ion IOrgan izationSer vice Membe rs | |||||
| 65 | publ ic void As sociate(st ring entit yName, Gui d entityId , Relation ship relat ionship, E ntityRefer enceCollec tion relat edEntities ) | |||||
| 66 | { | |||||
| 67 | this.E xecuteSoap Request<As sociateReq uest, Asso ciateRespo nse>( | |||||
| 68 | new Asso ciateReque st(entityN ame, entit yId, relat ionship, r elatedEnti ties)); | |||||
| 69 | } | |||||
| 70 | ||||||
| 71 | publ ic Guid Cr eate(Entit y entity) | |||||
| 72 | { | |||||
| 73 | return this.Exec uteSoapReq uest<Creat eRequest, CreateResp onse>(new CreateRequ est(entity )).Id; | |||||
| 74 | } | |||||
| 75 | ||||||
| 76 | publ ic void De lete(strin g entityNa me, Guid i d) | |||||
| 77 | { | |||||
| 78 | this.E xecuteSoap Request<De leteReques t, DeleteR esponse>(n ew DeleteR equest(ent ityName, i d)); | |||||
| 79 | } | |||||
| 80 | ||||||
| 81 | publ ic void Di sassociate (string en tityName, Guid entit yId, Relat ionship re lationship , EntityRe ferenceCol lection re latedEntit ies) | |||||
| 82 | { | |||||
| 83 | this.E xecuteSoap Request<Di sassociate Request, D isassociat eResponse> ( | |||||
| 84 | new Disa ssociateRe quest(enti tyName, en tityId, re lationship , relatedE ntities)); | |||||
| 85 | } | |||||
| 86 | ||||||
| 87 | publ ic Organiz ationRespo nse Execut e(Organiza tionReques t request) | |||||
| 88 | { | |||||
| 89 | return this.Exec uteSoapReq uest<Execu teRequest, ExecuteRe sponse>(ne w ExecuteR equest(req uest)).Res ponse; | |||||
| 90 | } | |||||
| 91 | ||||||
| 92 | publ ic Entity Retrieve(s tring enti tyName, Gu id id, Col umnSet col umnSet) | |||||
| 93 | { | |||||
| 94 | return this.Exec uteSoapReq uest<Retri eveRequest , Retrieve Response>( new Retrie veRequest( entityName , id, colu mnSet)).En tity; | |||||
| 95 | } | |||||
| 96 | ||||||
| 97 | publ ic EntityC ollection RetrieveMu ltiple(Que ryBase que ry) | |||||
| 98 | { | |||||
| 99 | return this.Exec uteSoapReq uest<Retri eveMultipl eRequest, RetrieveMu ltipleResp onse>( | |||||
| 100 | new Retr ieveMultip leRequest( query)).En tityCollec tion; | |||||
| 101 | } | |||||
| 102 | ||||||
| 103 | publ ic void Up date(Entit y entity) | |||||
| 104 | { | |||||
| 105 | this.E xecuteSoap Request<Up dateReques t, UpdateR esponse>(n ew UpdateR equest(ent ity)); | |||||
| 106 | } | |||||
| 107 | #end region | |||||
| 108 | ||||||
| 109 | #reg ion Privat e Methods | |||||
| 110 | priv ate TRespo nse Execut eSoapReque st<TReques t, TRespon se>(TReque st request ) | |||||
| 111 | where TRequest : RequestBa se | |||||
| 112 | where TResponse : Response Base | |||||
| 113 | { | |||||
| 114 | Output SoapReques t(request) ; | |||||
| 115 | ||||||
| 116 | TRespo nse respon se; | |||||
| 117 | try | |||||
| 118 | { | |||||
| 119 | response = (TRespo nse)reques t.Execute( this.Inner Service); | |||||
| 120 | } | |||||
| 121 | catch (FaultExce ption<Orga nizationSe rviceFault > ex) | |||||
| 122 | { | |||||
| 123 | this.Out putSoapRes ponse(new FaultRespo nse(ex)); | |||||
| 124 | throw; | |||||
| 125 | } | |||||
| 126 | ||||||
| 127 | this.O utputSoapR esponse(re sponse); | |||||
| 128 | return response; | |||||
| 129 | } | |||||
| 130 | ||||||
| 131 | priv ate void O utputSoapR equest(Req uestBase r equest) | |||||
| 132 | { | |||||
| 133 | this.O utputWrite r.WriteLin e(); | |||||
| 134 | this.O utputWrite r.WriteLin e("HTTP RE QUEST"); | |||||
| 135 | this.O utputWrite r.WriteLin e(new stri ng('-', 50 )); | |||||
| 136 | this.O utputWrite r.WriteLin e("POST {0 }/web", th is.RootSer viceUri); | |||||
| 137 | this.O utputWrite r.WriteLin e("Content -Type: tex t/xml; cha rset=utf-8 "); | |||||
| 138 | this.O utputWrite r.WriteLin e("SOAPAct ion: {0}", request.S oapAction) ; | |||||
| 139 | this.O utputWrite r.WriteLin e(); | |||||
| 140 | ||||||
| 141 | this.O utputSoapE nvelope(re quest); | |||||
| 142 | ||||||
| 143 | this.O utputWrite r.WriteLin e(new stri ng('-', 50 )); | |||||
| 144 | } | |||||
| 145 | ||||||
| 146 | priv ate void O utputSoapR esponse(ob ject respo nse) | |||||
| 147 | { | |||||
| 148 | this.O utputWrite r.WriteLin e(); | |||||
| 149 | this.O utputWrite r.WriteLin e("HTTP RE SPONSE"); | |||||
| 150 | this.O utputWrite r.WriteLin e(new stri ng('-', 50 )); | |||||
| 151 | this.O utputSoapE nvelope(re sponse); | |||||
| 152 | this.O utputWrite r.WriteLin e(new stri ng('-', 50 )); | |||||
| 153 | } | |||||
| 154 | ||||||
| 155 | priv ate void O utputSoapE nvelope(ob ject value ) | |||||
| 156 | { | |||||
| 157 | this.O utputWrite r.WriteLin e(FormatXm l(string.F ormat(Cult ureInfo.In variantCul ture, | |||||
| 158 | @"<s:Env elope xmln s:s=""http ://schemas .xmlsoap.o rg/soap/en velope/""> <s:Body>{0 }</s:Body> </s:Envelo pe>", | |||||
| 159 | Serializ e(value))) ); | |||||
| 160 | } | |||||
| 161 | ||||||
| 162 | priv ate string FormatXml (string xm l) | |||||
| 163 | { | |||||
| 164 | using (StringRea der string Reader = n ew StringR eader(xml) ) | |||||
| 165 | { | |||||
| 166 | XmlReade rSettings readerSett ings = new XmlReader Settings() ; | |||||
| 167 | readerSe ttings.Ign oreWhitesp ace = true ; | |||||
| 168 | readerSe ttings.Con formanceLe vel = Conf ormanceLev el.Fragmen t; | |||||
| 169 | ||||||
| 170 | XmlDocum ent doc = new XmlDoc ument(); | |||||
| 171 | using (X mlReader r eader = Xm lReader.Cr eate(strin gReader, r eaderSetti ngs)) | |||||
| 172 | { | |||||
| 173 | doc.XmlRes olver = nu ll; | |||||
| 174 | doc.Load(r eader); | |||||
| 175 | } | |||||
| 176 | ||||||
| 177 | XmlWrite rSettings writerSett ings = new XmlWriter Settings() ; | |||||
| 178 | writerSe ttings.Ind ent = true ; | |||||
| 179 | writerSe ttings.Omi tXmlDeclar ation = tr ue; | |||||
| 180 | ||||||
| 181 | using (S tringWrite r stringWr iter = new StringWri ter(Cultur eInfo.Inva riantCultu re)) | |||||
| 182 | { | |||||
| 183 | using (Xml Writer wri ter = XmlW riter.Crea te(stringW riter, wri terSetting s)) | |||||
| 184 | { | |||||
| 185 | do c.Save(wri ter); | |||||
| 186 | } | |||||
| 187 | ||||||
| 188 | return str ingWriter. ToString() ; | |||||
| 189 | } | |||||
| 190 | } | |||||
| 191 | } | |||||
| 192 | ||||||
| 193 | priv ate string Serialize (object va lue) | |||||
| 194 | { | |||||
| 195 | if (nu ll == valu e) | |||||
| 196 | { | |||||
| 197 | return n ull; | |||||
| 198 | } | |||||
| 199 | ||||||
| 200 | using (MemoryStr eam stream = new Mem oryStream( )) | |||||
| 201 | { | |||||
| 202 | DataCont ractSerial izer seria lizer = ne w DataCont ractSerial izer(value .GetType() , null, in t.MaxValue , true, fa lse, | |||||
| 203 | new Strong ToLooseTyp eSurrogate (), new Kn ownTypesRe solver()); | |||||
| 204 | serializ er.WriteOb ject(strea m, value); | |||||
| 205 | stream.S eek(0, See kOrigin.Be gin); | |||||
| 206 | ||||||
| 207 | using (S treamReade r reader = new Strea mReader(st ream)) | |||||
| 208 | { | |||||
| 209 | return rea der.ReadTo End(); | |||||
| 210 | } | |||||
| 211 | } | |||||
| 212 | } | |||||
| 213 | #end region | |||||
| 214 | ||||||
| 215 | #reg ion Privat e Classes | |||||
| 216 | priv ate sealed class Str ongToLoose TypeSurrog ate : IDat aContractS urrogate | |||||
| 217 | { | |||||
| 218 | #regio n IDataCon tractSurro gate Membe rs | |||||
| 219 | public object Ge tCustomDat aToExport( Type clrTy pe, Type d ataContrac tType) | |||||
| 220 | { | |||||
| 221 | return n ull; | |||||
| 222 | } | |||||
| 223 | ||||||
| 224 | public object Ge tCustomDat aToExport( System.Ref lection.Me mberInfo m emberInfo, Type data ContractTy pe) | |||||
| 225 | { | |||||
| 226 | return n ull; | |||||
| 227 | } | |||||
| 228 | ||||||
| 229 | public Type GetD ataContrac tType(Type type) | |||||
| 230 | { | |||||
| 231 | return t ype; | |||||
| 232 | } | |||||
| 233 | ||||||
| 234 | public object Ge tDeseriali zedObject( object obj , Type tar getType) | |||||
| 235 | { | |||||
| 236 | return o bj; | |||||
| 237 | } | |||||
| 238 | ||||||
| 239 | public void GetK nownCustom DataTypes( Collection <Type> cus tomDataTyp es) | |||||
| 240 | { | |||||
| 241 | return; | |||||
| 242 | } | |||||
| 243 | ||||||
| 244 | public object Ge tObjectToS erialize(o bject obj, Type targ etType) | |||||
| 245 | { | |||||
| 246 | if (null != obj && typeof(En tity).IsAs signableFr om(obj.Get Type())) | |||||
| 247 | { | |||||
| 248 | return ((E ntity)obj) .ToEntity< Entity>(); | |||||
| 249 | } | |||||
| 250 | ||||||
| 251 | return o bj; | |||||
| 252 | } | |||||
| 253 | ||||||
| 254 | public Type GetR eferencedT ypeOnImpor t(string t ypeName, s tring type Namespace, object cu stomData) | |||||
| 255 | { | |||||
| 256 | return n ull; | |||||
| 257 | } | |||||
| 258 | ||||||
| 259 | public CodeTypeD eclaration ProcessIm portedType (CodeTypeD eclaration typeDecla ration, Co deCompileU nit compil eUnit) | |||||
| 260 | { | |||||
| 261 | return t ypeDeclara tion; | |||||
| 262 | } | |||||
| 263 | #endre gion | |||||
| 264 | } | |||||
| 265 | ||||||
| 266 | [Dat aContract] | |||||
| 267 | priv ate abstra ct class R equestBase | |||||
| 268 | { | |||||
| 269 | privat e const st ring SoapA ctionPrefi x = "http: //schemas. microsoft. com/xrm/20 11/Contrac ts/Service s/IOrganiz ationServi ce/"; | |||||
| 270 | ||||||
| 271 | protec ted Reques tBase() | |||||
| 272 | { | |||||
| 273 | DataCont ractAttrib ute[] attr ibutes = ( DataContra ctAttribut e[])this.G etType().G etCustomAt tributes( | |||||
| 274 | typeof(Dat aContractA ttribute), true); | |||||
| 275 | if (null == attrib utes || 0 == attribu tes.Length ) | |||||
| 276 | { | |||||
| 277 | this.SoapA ction = nu ll; | |||||
| 278 | return; | |||||
| 279 | } | |||||
| 280 | ||||||
| 281 | this.Soa pAction = SoapAction Prefix + a ttributes[ 0].Name; | |||||
| 282 | } | |||||
| 283 | ||||||
| 284 | public string So apAction { get; priv ate set; } | |||||
| 285 | ||||||
| 286 | public abstract ResponseBa se Execute (IOrganiza tionServic e service) ; | |||||
| 287 | } | |||||
| 288 | ||||||
| 289 | [Dat aContract] | |||||
| 290 | priv ate abstra ct class R esponseBas e | |||||
| 291 | { | |||||
| 292 | } | |||||
| 293 | ||||||
| 294 | [Dat aContract( Name = "Fa ult", Name space = "h ttp://www. w3.org/200 3/05/soap- envelope") ] | |||||
| 295 | priv ate sealed class Fau ltResponse : Respons eBase | |||||
| 296 | { | |||||
| 297 | #regio n Construc tors | |||||
| 298 | public FaultResp onse() | |||||
| 299 | { | |||||
| 300 | } | |||||
| 301 | ||||||
| 302 | public FaultResp onse(Fault Exception< Organizati onServiceF ault> exce ption) | |||||
| 303 | { | |||||
| 304 | if (null == except ion) | |||||
| 305 | { | |||||
| 306 | throw new ArgumentNu llExceptio n("excepti on"); | |||||
| 307 | } | |||||
| 308 | ||||||
| 309 | this.Fau ltCode = n ew FaultCo de(excepti on.Code); | |||||
| 310 | this.Fau ltString = new Fault Reason(exc eption.Mes sage); | |||||
| 311 | this.Det ail = exce ption.Deta il; | |||||
| 312 | } | |||||
| 313 | #endre gion | |||||
| 314 | ||||||
| 315 | #regio n Properti es | |||||
| 316 | [DataM ember(Name = "Code", Order = 1 )] | |||||
| 317 | public FaultCode FaultCode { get; pr ivate set; } | |||||
| 318 | ||||||
| 319 | [DataM ember(Name = "Reason ", Order = 2)] | |||||
| 320 | public FaultReas on FaultSt ring { get ; private set; } | |||||
| 321 | ||||||
| 322 | [DataM ember(Name = "Detail ", Order = 3)] | |||||
| 323 | public Organizat ionService Fault Deta il { get; private se t; } | |||||
| 324 | #endre gion | |||||
| 325 | } | |||||
| 326 | ||||||
| 327 | [Dat aContract( Namespace = "http:// www.w3.org /2003/05/s oap-envelo pe")] | |||||
| 328 | priv ate sealed class Fau ltCode : R esponseBas e | |||||
| 329 | { | |||||
| 330 | #regio n Construc tors | |||||
| 331 | public FaultCode () | |||||
| 332 | { | |||||
| 333 | } | |||||
| 334 | ||||||
| 335 | public FaultCode (System.Se rviceModel .FaultCode code) | |||||
| 336 | { | |||||
| 337 | string n s = null; | |||||
| 338 | if (!str ing.IsNull OrWhiteSpa ce(code.Na mespace)) | |||||
| 339 | { | |||||
| 340 | ns = code. Namespace + ":"; | |||||
| 341 | } | |||||
| 342 | ||||||
| 343 | this.Val ue = ns + code.Name; | |||||
| 344 | } | |||||
| 345 | #endre gion | |||||
| 346 | ||||||
| 347 | #regio n Properti es | |||||
| 348 | [DataM ember(Name = "Value" , Order = 1)] | |||||
| 349 | public string Va lue { get; private s et; } | |||||
| 350 | #endre gion | |||||
| 351 | } | |||||
| 352 | ||||||
| 353 | [Dat aContract( Namespace = "http:// www.w3.org /2003/05/s oap-envelo pe")] | |||||
| 354 | priv ate sealed class Fau ltReason : ResponseB ase | |||||
| 355 | { | |||||
| 356 | #regio n Construc tors | |||||
| 357 | public FaultReas on() | |||||
| 358 | { | |||||
| 359 | } | |||||
| 360 | ||||||
| 361 | public FaultReas on(string text) | |||||
| 362 | { | |||||
| 363 | this.Tex t = text; | |||||
| 364 | } | |||||
| 365 | #endre gion | |||||
| 366 | ||||||
| 367 | #regio n Properti es | |||||
| 368 | [DataM ember(Name = "Text", Order = 1 )] | |||||
| 369 | public string Te xt { get; private se t; } | |||||
| 370 | #endre gion | |||||
| 371 | } | |||||
| 372 | ||||||
| 373 | [Dat aContract( Name = "As sociate", Namespace = "http:// schemas.mi crosoft.co m/xrm/2011 /Contracts /Services" )] | |||||
| 374 | priv ate sealed class Ass ociateRequ est : Requ estBase | |||||
| 375 | { | |||||
| 376 | public Associate Request(st ring entit yName, Gui d entityId , Relation ship relat ionship, E ntityRefer enceCollec tion relat edEntities ) | |||||
| 377 | { | |||||
| 378 | this.Ent ityName = entityName ; | |||||
| 379 | this.Ent ityId = en tityId; | |||||
| 380 | this.Rel ationship = relation ship; | |||||
| 381 | this.Rel atedEntiti es = relat edEntities ; | |||||
| 382 | } | |||||
| 383 | ||||||
| 384 | #regio n Properti es | |||||
| 385 | [DataM ember(Name = "entity Name", Ord er = 1)] | |||||
| 386 | public string En tityName { get; priv ate set; } | |||||
| 387 | ||||||
| 388 | [DataM ember(Name = "entity Id", Order = 2)] | |||||
| 389 | public Guid Enti tyId { get ; private set; } | |||||
| 390 | ||||||
| 391 | [DataM ember(Name = "relati onship", O rder = 3)] | |||||
| 392 | public Relations hip Relati onship { g et; privat e set; } | |||||
| 393 | ||||||
| 394 | [DataM ember(Name = "relate dEntities" , Order = 4)] | |||||
| 395 | public EntityRef erenceColl ection Rel atedEntiti es { get; private se t; } | |||||
| 396 | #endre gion | |||||
| 397 | ||||||
| 398 | #regio n Methods | |||||
| 399 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 400 | { | |||||
| 401 | service. Associate( this.Entit yName, thi s.EntityId , this.Rel ationship, this.Rela tedEntitie s); | |||||
| 402 | return n ew Associa teResponse (); | |||||
| 403 | } | |||||
| 404 | #endre gion | |||||
| 405 | } | |||||
| 406 | ||||||
| 407 | [Dat aContract( Name = "As sociateRes ponse", Na mespace = "http://sc hemas.micr osoft.com/ xrm/2011/C ontracts/S ervices")] | |||||
| 408 | ||||||
| 409 | priv ate sealed class Ass ociateResp onse : Res ponseBase | |||||
| 410 | { | |||||
| 411 | } | |||||
| 412 | ||||||
| 413 | [Dat aContract( Name = "Di sassociate ", Namespa ce = "http ://schemas .microsoft .com/xrm/2 011/Contra cts/Servic es")] | |||||
| 414 | priv ate sealed class Dis associateR equest : R equestBase | |||||
| 415 | { | |||||
| 416 | public Disassoci ateRequest (string en tityName, Guid entit yId, Relat ionship re lationship , EntityRe ferenceCol lection re latedEntit ies) | |||||
| 417 | { | |||||
| 418 | this.Ent ityName = entityName ; | |||||
| 419 | this.Ent ityId = en tityId; | |||||
| 420 | this.Rel ationship = relation ship; | |||||
| 421 | this.Rel atedEntiti es = relat edEntities ; | |||||
| 422 | } | |||||
| 423 | ||||||
| 424 | #regio n Properti es | |||||
| 425 | [DataM ember(Name = "entity Name", Ord er = 1)] | |||||
| 426 | public string En tityName { get; priv ate set; } | |||||
| 427 | ||||||
| 428 | [DataM ember(Name = "entity Id", Order = 2)] | |||||
| 429 | public Guid Enti tyId { get ; private set; } | |||||
| 430 | ||||||
| 431 | [DataM ember(Name = "relati onship", O rder = 3)] | |||||
| 432 | public Relations hip Relati onship { g et; privat e set; } | |||||
| 433 | ||||||
| 434 | [DataM ember(Name = "relate dEntities" , Order = 4)] | |||||
| 435 | public EntityRef erenceColl ection Rel atedEntiti es { get; private se t; } | |||||
| 436 | #endre gion | |||||
| 437 | ||||||
| 438 | #regio n Methods | |||||
| 439 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 440 | { | |||||
| 441 | service. Disassocia te(this.En tityName, this.Entit yId, this. Relationsh ip, this.R elatedEnti ties); | |||||
| 442 | return n ew Disasso ciateRespo nse(); | |||||
| 443 | } | |||||
| 444 | #endre gion | |||||
| 445 | } | |||||
| 446 | ||||||
| 447 | [Dat aContract( Name = "Di sassociate Response", Namespace = "http:/ /schemas.m icrosoft.c om/xrm/201 1/Contract s/Services ")] | |||||
| 448 | priv ate sealed class Dis associateR esponse : ResponseBa se | |||||
| 449 | { | |||||
| 450 | } | |||||
| 451 | ||||||
| 452 | [Dat aContract( Name = "Cr eate", Nam espace = " http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices")] | |||||
| 453 | priv ate sealed class Cre ateRequest : Request Base | |||||
| 454 | { | |||||
| 455 | public CreateReq uest(Entit y entity) | |||||
| 456 | { | |||||
| 457 | this.Ent ity = enti ty; | |||||
| 458 | } | |||||
| 459 | ||||||
| 460 | #regio n Properti es | |||||
| 461 | [DataM ember(Name = "entity ", Order = 1)] | |||||
| 462 | public Entity En tity { get ; private set; } | |||||
| 463 | #endre gion | |||||
| 464 | ||||||
| 465 | #regio n Methods | |||||
| 466 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 467 | { | |||||
| 468 | return n ew CreateR esponse(se rvice.Crea te(this.En tity)); | |||||
| 469 | } | |||||
| 470 | #endre gion | |||||
| 471 | } | |||||
| 472 | ||||||
| 473 | [Dat aContract( Name = "Cr eateRespon se", Names pace = "ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices")] | |||||
| 474 | priv ate sealed class Cre ateRespons e : Respon seBase | |||||
| 475 | { | |||||
| 476 | #regio n Construc tors | |||||
| 477 | public CreateRes ponse() | |||||
| 478 | { | |||||
| 479 | } | |||||
| 480 | ||||||
| 481 | public CreateRes ponse(Guid id) | |||||
| 482 | { | |||||
| 483 | this.Id = id; | |||||
| 484 | } | |||||
| 485 | #endre gion | |||||
| 486 | ||||||
| 487 | #regio n Properti es | |||||
| 488 | [DataM ember(Name = "Create Result", O rder = 1)] | |||||
| 489 | public Guid Id { get; priv ate set; } | |||||
| 490 | #endre gion | |||||
| 491 | } | |||||
| 492 | ||||||
| 493 | [Dat aContract( Name = "De lete", Nam espace = " http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices")] | |||||
| 494 | priv ate sealed class Del eteRequest : Request Base | |||||
| 495 | { | |||||
| 496 | public DeleteReq uest(strin g entityNa me, Guid i d) | |||||
| 497 | { | |||||
| 498 | this.Ent ityName = entityName ; | |||||
| 499 | this.Ent ityId = id ; | |||||
| 500 | } | |||||
| 501 | ||||||
| 502 | #regio n Properti es | |||||
| 503 | [DataM ember(Name = "entity Name", Ord er = 1)] | |||||
| 504 | public string En tityName { get; priv ate set; } | |||||
| 505 | ||||||
| 506 | [DataM ember(Name = "id", O rder = 2)] | |||||
| 507 | public Guid Enti tyId { get ; private set; } | |||||
| 508 | #endre gion | |||||
| 509 | ||||||
| 510 | #regio n Methods | |||||
| 511 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 512 | { | |||||
| 513 | service. Delete(thi s.EntityNa me, this.E ntityId); | |||||
| 514 | return n ew DeleteR esponse(); | |||||
| 515 | } | |||||
| 516 | #endre gion | |||||
| 517 | } | |||||
| 518 | ||||||
| 519 | [Dat aContract( Name = "De leteRespon se", Names pace = "ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices")] | |||||
| 520 | priv ate sealed class Del eteRespons e : Respon seBase | |||||
| 521 | { | |||||
| 522 | } | |||||
| 523 | ||||||
| 524 | [Dat aContract( Name = "Ex ecute", Na mespace = "http://sc hemas.micr osoft.com/ xrm/2011/C ontracts/S ervices")] | |||||
| 525 | priv ate sealed class Exe cuteReques t : Reques tBase | |||||
| 526 | { | |||||
| 527 | public ExecuteRe quest(Orga nizationRe quest requ est) | |||||
| 528 | { | |||||
| 529 | this.Req uest = req uest; | |||||
| 530 | } | |||||
| 531 | ||||||
| 532 | #regio n Properti es | |||||
| 533 | [DataM ember(Name = "reques t", Order = 1)] | |||||
| 534 | public Organizat ionRequest Request { get; priv ate set; } | |||||
| 535 | #endre gion | |||||
| 536 | ||||||
| 537 | #regio n Methods | |||||
| 538 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 539 | { | |||||
| 540 | return n ew Execute Response(s ervice.Exe cute(this. Request)); | |||||
| 541 | } | |||||
| 542 | #endre gion | |||||
| 543 | } | |||||
| 544 | ||||||
| 545 | [Dat aContract( Name = "Ex ecuteRespo nse", Name space = "h ttp://sche mas.micros oft.com/xr m/2011/Con tracts/Ser vices")] | |||||
| 546 | priv ate sealed class Exe cuteRespon se : Respo nseBase | |||||
| 547 | { | |||||
| 548 | #regio n Construc tors | |||||
| 549 | public ExecuteRe sponse() | |||||
| 550 | { | |||||
| 551 | } | |||||
| 552 | ||||||
| 553 | public ExecuteRe sponse(Org anizationR esponse re sponse) | |||||
| 554 | { | |||||
| 555 | this.Res ponse = re sponse; | |||||
| 556 | } | |||||
| 557 | #endre gion | |||||
| 558 | ||||||
| 559 | #regio n Properti es | |||||
| 560 | [DataM ember(Name = "Execut eResult", Order = 1) ] | |||||
| 561 | public Organizat ionRespons e Response { get; pr ivate set; } | |||||
| 562 | #endre gion | |||||
| 563 | } | |||||
| 564 | ||||||
| 565 | [Dat aContract( Name = "Re trieve", N amespace = "http://s chemas.mic rosoft.com /xrm/2011/ Contracts/ Services") ] | |||||
| 566 | priv ate sealed class Ret rieveReque st : Reque stBase | |||||
| 567 | { | |||||
| 568 | public RetrieveR equest(str ing entity Name, Guid id, Colum nSet colum nSet) | |||||
| 569 | { | |||||
| 570 | this.Ent ityName = entityName ; | |||||
| 571 | this.Id = id; | |||||
| 572 | this.Col umns = col umnSet; | |||||
| 573 | } | |||||
| 574 | ||||||
| 575 | #regio n Properti es | |||||
| 576 | [DataM ember(Name = "entity Name", Ord er = 1)] | |||||
| 577 | public string En tityName { get; priv ate set; } | |||||
| 578 | ||||||
| 579 | [DataM ember(Name = "id", O rder = 2)] | |||||
| 580 | public Guid Id { get; priv ate set; } | |||||
| 581 | ||||||
| 582 | [DataM ember(Name = "column Set", Orde r = 3)] | |||||
| 583 | public ColumnSet Columns { get; priv ate set; } | |||||
| 584 | #endre gion | |||||
| 585 | ||||||
| 586 | #regio n Methods | |||||
| 587 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 588 | { | |||||
| 589 | return n ew Retriev eResponse( service.Re trieve(thi s.EntityNa me, this.I d, this.Co lumns)); | |||||
| 590 | } | |||||
| 591 | #endre gion | |||||
| 592 | } | |||||
| 593 | ||||||
| 594 | [Dat aContract( Name = "Re trieveResp onse", Nam espace = " http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices")] | |||||
| 595 | priv ate sealed class Ret rieveRespo nse : Resp onseBase | |||||
| 596 | { | |||||
| 597 | #regio n Construc tors | |||||
| 598 | public RetrieveR esponse() | |||||
| 599 | { | |||||
| 600 | } | |||||
| 601 | ||||||
| 602 | public RetrieveR esponse(En tity entit y) | |||||
| 603 | { | |||||
| 604 | this.Ent ity = enti ty; | |||||
| 605 | } | |||||
| 606 | #endre gion | |||||
| 607 | ||||||
| 608 | #regio n Properti es | |||||
| 609 | [DataM ember(Name = "Retrie veResult", Order = 1 )] | |||||
| 610 | public Entity En tity { get ; private set; } | |||||
| 611 | #endre gion | |||||
| 612 | } | |||||
| 613 | ||||||
| 614 | [Dat aContract( Name = "Re trieveMult iple", Nam espace = " http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices")] | |||||
| 615 | priv ate sealed class Ret rieveMulti pleRequest : Request Base | |||||
| 616 | { | |||||
| 617 | public RetrieveM ultipleReq uest(Query Base query ) | |||||
| 618 | { | |||||
| 619 | this.Que ry = query ; | |||||
| 620 | } | |||||
| 621 | ||||||
| 622 | #regio n Properti es | |||||
| 623 | [DataM ember(Name = "query" , Order = 1)] | |||||
| 624 | public QueryBase Query { g et; privat e set; } | |||||
| 625 | #endre gion | |||||
| 626 | ||||||
| 627 | #regio n Methods | |||||
| 628 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 629 | { | |||||
| 630 | return n ew Retriev eMultipleR esponse(se rvice.Retr ieveMultip le(this.Qu ery)); | |||||
| 631 | } | |||||
| 632 | #endre gion | |||||
| 633 | } | |||||
| 634 | ||||||
| 635 | [Dat aContract( Name = "Re trieveMult ipleRespon se", Names pace = "ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices")] | |||||
| 636 | priv ate sealed class Ret rieveMulti pleRespons e : Respon seBase | |||||
| 637 | { | |||||
| 638 | #regio n Construc tors | |||||
| 639 | public RetrieveM ultipleRes ponse() | |||||
| 640 | { | |||||
| 641 | } | |||||
| 642 | ||||||
| 643 | public RetrieveM ultipleRes ponse(Enti tyCollecti on results ) | |||||
| 644 | { | |||||
| 645 | this.Ent ityCollect ion = resu lts; | |||||
| 646 | } | |||||
| 647 | #endre gion | |||||
| 648 | ||||||
| 649 | #regio n Properti es | |||||
| 650 | [DataM ember(Name = "Retrie veMultiple Result", O rder = 1)] | |||||
| 651 | public EntityCol lection En tityCollec tion { get ; private set; } | |||||
| 652 | #endre gion | |||||
| 653 | } | |||||
| 654 | ||||||
| 655 | [Dat aContract( Name = "Up date", Nam espace = " http://sch emas.micro soft.com/x rm/2011/Co ntracts/Se rvices")] | |||||
| 656 | priv ate sealed class Upd ateRequest : Request Base | |||||
| 657 | { | |||||
| 658 | public UpdateReq uest(Entit y entity) | |||||
| 659 | { | |||||
| 660 | this.Ent ity = enti ty; | |||||
| 661 | } | |||||
| 662 | ||||||
| 663 | #regio n Properti es | |||||
| 664 | [DataM ember(Name = "entity ", Order = 1)] | |||||
| 665 | public Entity En tity { get ; private set; } | |||||
| 666 | #endre gion | |||||
| 667 | ||||||
| 668 | #regio n Methods | |||||
| 669 | public override ResponseBa se Execute (IOrganiza tionServic e service) | |||||
| 670 | { | |||||
| 671 | service. Update(thi s.Entity); | |||||
| 672 | return n ew UpdateR esponse(); | |||||
| 673 | } | |||||
| 674 | #endre gion | |||||
| 675 | } | |||||
| 676 | ||||||
| 677 | [Dat aContract( Name = "Up dateRespon se", Names pace = "ht tp://schem as.microso ft.com/xrm /2011/Cont racts/Serv ices")] | |||||
| 678 | priv ate sealed class Upd ateRespons e : Respon seBase | |||||
| 679 | { | |||||
| 680 | } | |||||
| 681 | #end region | |||||
| 682 | } | |||||
| 683 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.