Skip to content

Commit 74751af

Browse files
CopilotYunchuWang
andcommitted
Address review feedback: add null check and preserve PascalCase parameters
Co-authored-by: YunchuWang <[email protected]>
1 parent 2fd545a commit 74751af

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

TestBackwardCompat.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net10.0</TargetFramework>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<ProjectReference Include="/home/runner/work/durabletask-dotnet/durabletask-dotnet/src/Abstractions/Abstractions.csproj" />
8+
</ItemGroup>
9+
</Project>

src/Abstractions/TaskOptions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public SubOrchestrationOptions(TaskOptions options, string? instanceId = null)
125125
public SubOrchestrationOptions(SubOrchestrationOptions options)
126126
: base(options)
127127
{
128+
Check.NotNull(options);
128129
this.InstanceId = options.InstanceId;
129130
this.Version = options.Version;
130131
}
@@ -148,17 +149,19 @@ public record StartOrchestrationOptions
148149
/// <summary>
149150
/// Initializes a new instance of the <see cref="StartOrchestrationOptions"/> class.
150151
/// </summary>
151-
/// <param name="instanceId">
152+
/// <param name="InstanceId">
152153
/// The unique ID of the orchestration instance to schedule. If not specified, a new GUID value is used.
153154
/// </param>
154-
/// <param name="startAt">
155+
/// <param name="StartAt">
155156
/// The time when the orchestration instance should start executing. If not specified or if a date-time in the past
156157
/// is specified, the orchestration instance will be scheduled immediately.
157158
/// </param>
158-
public StartOrchestrationOptions(string? instanceId = null, DateTimeOffset? startAt = null)
159+
#pragma warning disable SA1313 // Parameter names should begin with lower-case letter - using PascalCase to maintain backward compatibility with positional record syntax
160+
public StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null)
161+
#pragma warning restore SA1313
159162
{
160-
this.InstanceId = instanceId;
161-
this.StartAt = startAt;
163+
this.InstanceId = InstanceId;
164+
this.StartAt = StartAt;
162165
}
163166

164167
/// <summary>

0 commit comments

Comments
 (0)