Skip to content

Commit 527ebae

Browse files
author
Release-Agent
committed
''
1 parent 44a1af6 commit 527ebae

29 files changed

+4111
-202
lines changed

src/Build.Common.core.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<PropertyGroup Condition="'$(ProjectSpecificFx)' == ''">
8-
<TargetFrameworks>net462;net472;net48;netcoreapp3.1;netstandard2.0;net6.0</TargetFrameworks>
8+
<TargetFrameworks>net462;net472;net48;netstandard2.0;net6.0</TargetFrameworks>
99
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
1010
</PropertyGroup>
1111

src/Build.Shared.props

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@
88
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
99
<PackageVersion_Adal>3.19.8</PackageVersion_Adal>
1010
<PackageVersion_MSAL>4.35.1</PackageVersion_MSAL>
11-
<PackageVersion_CdsSdk>4.9.665-v9.0-master</PackageVersion_CdsSdk>
12-
<PackageVersion_CrmProxy>4.9.665-v9.0-master</PackageVersion_CrmProxy>
11+
<PackageVersion_CdsSdk>4.9.3165-v9.0-weekly-2304.2</PackageVersion_CdsSdk>
12+
<PackageVersion_CrmProxy>4.9.3165-v9.0-weekly-2304.2</PackageVersion_CrmProxy>
1313
<PackageVersion_CDSServerNuget>4.6.6061-weekly-2108.5</PackageVersion_CDSServerNuget>
1414
<PackageVersion_Newtonsoft>13.0.1</PackageVersion_Newtonsoft>
1515
<PackageVersion_RestClientRuntime>2.3.20</PackageVersion_RestClientRuntime>
16-
<PackageVersion_XrmSdk>9.0.2.45</PackageVersion_XrmSdk>
16+
<PackageVersion_XrmSdk>9.0.2.48</PackageVersion_XrmSdk>
1717
<PackageVersion_Dep_OutlookXrmSdk>9.0.2.34</PackageVersion_Dep_OutlookXrmSdk>
18-
<PackageVersion_BatchedTelemetry>3.0.5</PackageVersion_BatchedTelemetry>
18+
<PackageVersion_BatchedTelemetry>3.0.8</PackageVersion_BatchedTelemetry>
1919
<PackageVersion_DataverseClient>0.4.20</PackageVersion_DataverseClient>
2020
<PackageVersion_CoverletCollector>3.1.0</PackageVersion_CoverletCollector>
2121
<PackageVersion_Microsoft_Extensions>3.1.8</PackageVersion_Microsoft_Extensions>
22+
<PackageVersion_SystemRuntime>6.0.0</PackageVersion_SystemRuntime>
2223

2324
<!-- Test: -->
2425
<PackageVersion_MicrosoftNETTestSdk>17.5.0</PackageVersion_MicrosoftNETTestSdk>

src/GeneralTools/DataverseClient/Client/BatchManager.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
55
using Microsoft.Xrm.Sdk;
66
using Microsoft.Xrm.Sdk.Messages;
77
using System.Globalization;
88
using System.Diagnostics.CodeAnalysis;
9+
using System.Diagnostics;
910

1011
namespace Microsoft.PowerPlatform.Dataverse.Client
1112
{
@@ -34,22 +35,24 @@ internal sealed class BatchManager
3435
/// </summary>
3536
private DataverseTraceLogger logger = null;
3637

37-
#endregion
38+
#endregion
3839

39-
/// <summary>
40-
/// Base Constructor..
41-
/// </summary>
42-
/// <param name="MaxBatches">Max number of concurrent batches possible</param>
43-
/// <param name="MaxRequestPerBatch">Max number of requests per Batch</param>
44-
/// <param name="traceLogger">TraceLogger</param>
45-
public BatchManager(DataverseTraceLogger traceLogger, int MaxBatches = 50000, int MaxRequestPerBatch = 5000)
40+
/// <summary>
41+
/// Base Constructor..
42+
/// </summary>
43+
/// <param name="MaxBatches">Max number of concurrent batches possible</param>
44+
/// <param name="MaxRequestPerBatch">Max number of requests per Batch</param>
45+
/// <param name="IsClonedConnection">Indicates if the connection is being cloned</param>
46+
/// <param name="traceLogger">TraceLogger</param>
47+
public BatchManager(DataverseTraceLogger traceLogger, int MaxBatches = 50000, int MaxRequestPerBatch = 5000, bool IsClonedConnection = false)
4648
{
4749
logger = traceLogger;
4850
// Do a Version Check here?
4951
MaxNumberOfBatches = MaxBatches;
5052
MaxNumberOfRequestsInABatch = MaxRequestPerBatch;
5153
RequestBatches = new Dictionary<Guid, RequestBatch>();
52-
logger.Log(string.Format(CultureInfo.InvariantCulture, "New Batch Manager Created, Max #of Batches:{0}, Max #of RequestsPerBatch:{1}", MaxBatches, MaxRequestPerBatch), System.Diagnostics.TraceEventType.Verbose);
54+
if (!IsClonedConnection)
55+
logger.Log(string.Format(CultureInfo.InvariantCulture, "New Batch Manager Created, Max #of Batches:{0}, Max #of RequestsPerBatch:{1}", MaxBatches, MaxRequestPerBatch), TraceEventType.Verbose);
5356
}
5457

5558
/// <summary>

src/GeneralTools/DataverseClient/Client/ConnectionService.cs

Lines changed: 75 additions & 41 deletions
Large diffs are not rendered by default.

src/GeneralTools/DataverseClient/Client/DataverseDataTypeWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;

src/GeneralTools/DataverseClient/Client/Extensions/DeploymentExtensions.cs

Lines changed: 349 additions & 18 deletions
Large diffs are not rendered by default.
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
#pragma warning disable CS1591
2+
3+
using Microsoft.Xrm.Sdk;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace Microsoft.PowerPlatform.Dataverse.Client.Extensions
11+
{
12+
public class AsyncStatusResponse
13+
{
14+
/// <summary>
15+
/// Status of the system job.
16+
/// </summary>
17+
public enum AsyncStatusResponse_statecode
18+
{
19+
Ready = 0,
20+
Suspended = 1,
21+
Locked = 2,
22+
Completed = 3,
23+
FailedParse = 999
24+
}
25+
26+
/// <summary>
27+
/// Reason for the status of the system job.
28+
/// </summary>
29+
public enum AsyncStatusResponse_statuscode
30+
{
31+
WaitingForResources = 0,
32+
Waiting = 10,
33+
InProgress = 20,
34+
Pausing = 21,
35+
Canceling = 22,
36+
Succeeded = 30,
37+
Failed = 31,
38+
Canceled = 32,
39+
FailedParse = 999
40+
}
41+
42+
/// <summary>
43+
/// Raw entity returned from the operation status poll.
44+
/// </summary>
45+
public Entity RetrievedEntity { get; set; }
46+
47+
/// <summary>
48+
/// Operation Id.
49+
/// </summary>
50+
public Guid AsyncOperationId
51+
{
52+
get
53+
{
54+
if (RetrievedEntity != null)
55+
return RetrievedEntity.Id;
56+
else
57+
return Guid.Empty;
58+
}
59+
}
60+
61+
/// <summary>
62+
/// Name of the Operation
63+
/// </summary>
64+
public string OperationName
65+
{
66+
get
67+
{
68+
if (RetrievedEntity != null)
69+
return RetrievedEntity.Attributes.ContainsKey("name") ? RetrievedEntity.GetAttributeValue<string>("name") : string.Empty;
70+
else
71+
return string.Empty;
72+
}
73+
}
74+
75+
/// <summary>
76+
/// Type of the Operation <see href="https://learn.microsoft.com/power-apps/developer/data-platform/reference/entities/asyncoperation#operationtype-choicesoptions"/>
77+
/// </summary>
78+
public string OperationType
79+
{
80+
get
81+
{
82+
if (RetrievedEntity != null)
83+
return RetrievedEntity.Attributes.ContainsKey("operationtype") ? RetrievedEntity.FormattedValues["operationtype"] : string.Empty;
84+
else
85+
return string.Empty;
86+
}
87+
}
88+
89+
/// <summary>
90+
/// User readable message, if available.
91+
/// </summary>
92+
public string FriendlyMessage
93+
{
94+
get
95+
{
96+
if (RetrievedEntity != null)
97+
return RetrievedEntity.Attributes.ContainsKey("friendlymessage") ? RetrievedEntity.GetAttributeValue<string>("friendlymessage") : string.Empty;
98+
else
99+
return string.Empty;
100+
}
101+
}
102+
103+
/// <summary>
104+
/// System message, if available
105+
/// </summary>
106+
public string Message
107+
{
108+
get
109+
{
110+
if (RetrievedEntity != null)
111+
return RetrievedEntity.Attributes.ContainsKey("message") ? RetrievedEntity.GetAttributeValue<string>("message") : string.Empty;
112+
else
113+
return string.Empty;
114+
}
115+
}
116+
117+
/// <summary>
118+
/// Correlation id
119+
/// </summary>
120+
public Guid CorrlationId
121+
{
122+
get
123+
{
124+
if (RetrievedEntity != null)
125+
return RetrievedEntity.Attributes.ContainsKey("correlationid") ? RetrievedEntity.GetAttributeValue<Guid>("correlationid") : Guid.Empty;
126+
else
127+
return Guid.Empty;
128+
}
129+
}
130+
131+
/// <summary>
132+
/// Operation Status Code.
133+
/// </summary>
134+
public AsyncStatusResponse_statuscode StatusCode { get; internal set; }
135+
136+
/// <summary>
137+
/// Localized text version of Status code, if available
138+
/// </summary>
139+
public string StatusCode_Localized {
140+
get
141+
{
142+
if (RetrievedEntity != null)
143+
return RetrievedEntity.Attributes.ContainsKey("statuscode") ? RetrievedEntity.FormattedValues["statuscode"] : string.Empty;
144+
else
145+
return string.Empty;
146+
}
147+
}
148+
149+
/// <summary>
150+
/// Operation State code
151+
/// </summary>
152+
public AsyncStatusResponse_statecode State { get; internal set; }
153+
154+
/// <summary>
155+
/// Localized text version of state code text, if available
156+
/// </summary>
157+
public string State_Localized
158+
{
159+
get
160+
{
161+
if (RetrievedEntity != null)
162+
return RetrievedEntity.Attributes.ContainsKey("statecode") ? RetrievedEntity.FormattedValues["statecode"] : string.Empty;
163+
else
164+
return string.Empty;
165+
}
166+
}
167+
168+
/// <summary>
169+
/// Creates an AsyncStatusResponse Object
170+
/// </summary>
171+
/// <param name="asyncOperationResponses"></param>
172+
internal AsyncStatusResponse(EntityCollection asyncOperationResponses)
173+
{
174+
// parse the Async Operation type.
175+
if (asyncOperationResponses == null)
176+
{
177+
// Do something Result is null.
178+
179+
}
180+
else if ( asyncOperationResponses != null && !asyncOperationResponses.Entities.Any()) {
181+
// Do something ( no records )
182+
}else
183+
{
184+
// not null and have records.
185+
this.RetrievedEntity = asyncOperationResponses.Entities.First(); // get first entity.
186+
// Parse state and status
187+
OptionSetValue ostatecode = RetrievedEntity.Attributes.ContainsKey("statecode") ? RetrievedEntity.GetAttributeValue<OptionSetValue>("statecode") : new OptionSetValue(-1);
188+
try
189+
{
190+
State = (AsyncStatusResponse_statecode)ostatecode.Value;
191+
}
192+
catch
193+
{
194+
State = AsyncStatusResponse_statecode.FailedParse;
195+
}
196+
197+
OptionSetValue ostatuscode = RetrievedEntity.Attributes.ContainsKey("statuscode") ? RetrievedEntity.GetAttributeValue<OptionSetValue>("statuscode") : new OptionSetValue(-1);
198+
try
199+
{
200+
StatusCode = (AsyncStatusResponse_statuscode)ostatuscode.Value;
201+
}
202+
catch
203+
{
204+
StatusCode = AsyncStatusResponse_statuscode.FailedParse;
205+
}
206+
207+
}
208+
}
209+
210+
}
211+
}
212+
#pragma warning restore CS1591

src/GeneralTools/DataverseClient/Client/Microsoft.PowerPlatform.Dataverse.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
4040
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="4.7.0" />
4141
<PackageReference Include="System.Security.Permissions" Version="5.0.0" />
42-
<PackageReference Include="System.ServiceModel.Http" Version="4.10.0" />
42+
<PackageReference Include="System.ServiceModel.Http" Version="4.10.2" />
4343
<PackageReference Include="System.Text.Json" Version="6.0.7" />
4444
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="2.18.9" />
4545
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="$(PackageVersion_Microsoft_Extensions)" />

0 commit comments

Comments
 (0)