Skip to content

Commit 3ca050f

Browse files
committed
Remove unnecessary parenthesis from everywhere
1 parent 141f704 commit 3ca050f

File tree

84 files changed

+332
-332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+332
-332
lines changed

src/WorkflowCore.DSL/Services/DefinitionLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private void AttachOutputs(StepSourceV1 source, Type dataType, Type stepType, Wo
250250
private void AttachOutcomes(StepSourceV1 source, Type dataType, WorkflowStep step)
251251
{
252252
if (!string.IsNullOrEmpty(source.NextStepId))
253-
step.Outcomes.Add(new ValueOutcome() { ExternalNextStepId = $"{source.NextStepId}" });
253+
step.Outcomes.Add(new ValueOutcome { ExternalNextStepId = $"{source.NextStepId}" });
254254

255255
var dataParameter = Expression.Parameter(dataType, "data");
256256
var outcomeParameter = Expression.Parameter(typeof(object), "outcome");

src/WorkflowCore/Models/ExecutionResult.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public ExecutionResult(object outcome)
3535

3636
public static ExecutionResult Outcome(object value)
3737
{
38-
return new ExecutionResult()
38+
return new ExecutionResult
3939
{
4040
Proceed = true,
4141
OutcomeValue = value
@@ -44,7 +44,7 @@ public static ExecutionResult Outcome(object value)
4444

4545
public static ExecutionResult Next()
4646
{
47-
return new ExecutionResult()
47+
return new ExecutionResult
4848
{
4949
Proceed = true,
5050
OutcomeValue = null
@@ -53,7 +53,7 @@ public static ExecutionResult Next()
5353

5454
public static ExecutionResult Persist(object persistenceData)
5555
{
56-
return new ExecutionResult()
56+
return new ExecutionResult
5757
{
5858
Proceed = false,
5959
PersistenceData = persistenceData
@@ -62,7 +62,7 @@ public static ExecutionResult Persist(object persistenceData)
6262

6363
public static ExecutionResult Branch(List<object> branches, object persistenceData)
6464
{
65-
return new ExecutionResult()
65+
return new ExecutionResult
6666
{
6767
Proceed = false,
6868
PersistenceData = persistenceData,
@@ -72,7 +72,7 @@ public static ExecutionResult Branch(List<object> branches, object persistenceDa
7272

7373
public static ExecutionResult Sleep(TimeSpan duration, object persistenceData)
7474
{
75-
return new ExecutionResult()
75+
return new ExecutionResult
7676
{
7777
Proceed = false,
7878
SleepFor = duration,
@@ -82,7 +82,7 @@ public static ExecutionResult Sleep(TimeSpan duration, object persistenceData)
8282

8383
public static ExecutionResult WaitForEvent(string eventName, string eventKey, DateTime effectiveDate)
8484
{
85-
return new ExecutionResult()
85+
return new ExecutionResult
8686
{
8787
Proceed = false,
8888
EventName = eventName,
@@ -93,7 +93,7 @@ public static ExecutionResult WaitForEvent(string eventName, string eventKey, Da
9393

9494
public static ExecutionResult WaitForActivity(string activityName, object subscriptionData, DateTime effectiveDate)
9595
{
96-
return new ExecutionResult()
96+
return new ExecutionResult
9797
{
9898
Proceed = false,
9999
EventName = Event.EventTypeActivity,

src/WorkflowCore/Models/Search/SearchFilter.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public class ScalarFilter : SearchFilter
2121
{
2222
public object Value { get; set; }
2323

24-
public static SearchFilter Equals(Expression<Func<WorkflowSearchResult, object>> property, object value) => new ScalarFilter()
24+
public static SearchFilter Equals(Expression<Func<WorkflowSearchResult, object>> property, object value) => new ScalarFilter
2525
{
2626
Property = property,
2727
Value = value
2828
};
2929

30-
public static SearchFilter Equals<T>(Expression<Func<T, object>> property, object value) => new ScalarFilter()
30+
public static SearchFilter Equals<T>(Expression<Func<T, object>> property, object value) => new ScalarFilter
3131
{
3232
IsData = true,
3333
DataType = typeof(T),
@@ -41,42 +41,42 @@ public class DateRangeFilter : SearchFilter
4141
public DateTime? BeforeValue { get; set; }
4242
public DateTime? AfterValue { get; set; }
4343

44-
public static DateRangeFilter Before(Expression<Func<WorkflowSearchResult, object>> property, DateTime value) => new DateRangeFilter()
44+
public static DateRangeFilter Before(Expression<Func<WorkflowSearchResult, object>> property, DateTime value) => new DateRangeFilter
4545
{
4646
Property = property,
4747
BeforeValue = value
4848
};
4949

50-
public static DateRangeFilter After(Expression<Func<WorkflowSearchResult, object>> property, DateTime value) => new DateRangeFilter()
50+
public static DateRangeFilter After(Expression<Func<WorkflowSearchResult, object>> property, DateTime value) => new DateRangeFilter
5151
{
5252
Property = property,
5353
AfterValue = value
5454
};
5555

56-
public static DateRangeFilter Between(Expression<Func<WorkflowSearchResult, object>> property, DateTime start, DateTime end) => new DateRangeFilter()
56+
public static DateRangeFilter Between(Expression<Func<WorkflowSearchResult, object>> property, DateTime start, DateTime end) => new DateRangeFilter
5757
{
5858
Property = property,
5959
BeforeValue = end,
6060
AfterValue = start
6161
};
6262

63-
public static DateRangeFilter Before<T>(Expression<Func<T, object>> property, DateTime value) => new DateRangeFilter()
63+
public static DateRangeFilter Before<T>(Expression<Func<T, object>> property, DateTime value) => new DateRangeFilter
6464
{
6565
IsData = true,
6666
DataType = typeof(T),
6767
Property = property,
6868
BeforeValue = value
6969
};
7070

71-
public static DateRangeFilter After<T>(Expression<Func<T, object>> property, DateTime value) => new DateRangeFilter()
71+
public static DateRangeFilter After<T>(Expression<Func<T, object>> property, DateTime value) => new DateRangeFilter
7272
{
7373
IsData = true,
7474
DataType = typeof(T),
7575
Property = property,
7676
AfterValue = value
7777
};
7878

79-
public static DateRangeFilter Between<T>(Expression<Func<T, object>> property, DateTime start, DateTime end) => new DateRangeFilter()
79+
public static DateRangeFilter Between<T>(Expression<Func<T, object>> property, DateTime start, DateTime end) => new DateRangeFilter
8080
{
8181
IsData = true,
8282
DataType = typeof(T),
@@ -91,42 +91,42 @@ public class NumericRangeFilter : SearchFilter
9191
public double? LessValue { get; set; }
9292
public double? GreaterValue { get; set; }
9393

94-
public static NumericRangeFilter LessThan(Expression<Func<WorkflowSearchResult, object>> property, double value) => new NumericRangeFilter()
94+
public static NumericRangeFilter LessThan(Expression<Func<WorkflowSearchResult, object>> property, double value) => new NumericRangeFilter
9595
{
9696
Property = property,
9797
LessValue = value
9898
};
9999

100-
public static NumericRangeFilter GreaterThan(Expression<Func<WorkflowSearchResult, object>> property, double value) => new NumericRangeFilter()
100+
public static NumericRangeFilter GreaterThan(Expression<Func<WorkflowSearchResult, object>> property, double value) => new NumericRangeFilter
101101
{
102102
Property = property,
103103
GreaterValue = value
104104
};
105105

106-
public static NumericRangeFilter Between(Expression<Func<WorkflowSearchResult, object>> property, double start, double end) => new NumericRangeFilter()
106+
public static NumericRangeFilter Between(Expression<Func<WorkflowSearchResult, object>> property, double start, double end) => new NumericRangeFilter
107107
{
108108
Property = property,
109109
LessValue = end,
110110
GreaterValue = start
111111
};
112112

113-
public static NumericRangeFilter LessThan<T>(Expression<Func<T, object>> property, double value) => new NumericRangeFilter()
113+
public static NumericRangeFilter LessThan<T>(Expression<Func<T, object>> property, double value) => new NumericRangeFilter
114114
{
115115
IsData = true,
116116
DataType = typeof(T),
117117
Property = property,
118118
LessValue = value
119119
};
120120

121-
public static NumericRangeFilter GreaterThan<T>(Expression<Func<T, object>> property, double value) => new NumericRangeFilter()
121+
public static NumericRangeFilter GreaterThan<T>(Expression<Func<T, object>> property, double value) => new NumericRangeFilter
122122
{
123123
IsData = true,
124124
DataType = typeof(T),
125125
Property = property,
126126
GreaterValue = value
127127
};
128128

129-
public static NumericRangeFilter Between<T>(Expression<Func<T, object>> property, double start, double end) => new NumericRangeFilter()
129+
public static NumericRangeFilter Between<T>(Expression<Func<T, object>> property, double start, double end) => new NumericRangeFilter
130130
{
131131
IsData = true,
132132
DataType = typeof(T),
@@ -144,7 +144,7 @@ protected StatusFilter()
144144
Property = lambda;
145145
}
146146

147-
public static StatusFilter Equals(WorkflowStatus value) => new StatusFilter()
147+
public static StatusFilter Equals(WorkflowStatus value) => new StatusFilter
148148
{
149149
Value = value.ToString()
150150
};

src/WorkflowCore/Models/StepBody.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public Task<ExecutionResult> RunAsync(IStepExecutionContext context)
1515

1616
protected ExecutionResult OutcomeResult(object value)
1717
{
18-
return new ExecutionResult()
18+
return new ExecutionResult
1919
{
2020
Proceed = true,
2121
OutcomeValue = value
@@ -24,7 +24,7 @@ protected ExecutionResult OutcomeResult(object value)
2424

2525
protected ExecutionResult PersistResult(object persistenceData)
2626
{
27-
return new ExecutionResult()
27+
return new ExecutionResult
2828
{
2929
Proceed = false,
3030
PersistenceData = persistenceData
@@ -33,7 +33,7 @@ protected ExecutionResult PersistResult(object persistenceData)
3333

3434
protected ExecutionResult SleepResult(object persistenceData, TimeSpan sleep)
3535
{
36-
return new ExecutionResult()
36+
return new ExecutionResult
3737
{
3838
Proceed = false,
3939
PersistenceData = persistenceData,

src/WorkflowCore/Primitives/Foreach.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public override ExecutionResult Run(IStepExecutionContext context)
1818
var values = Collection.Cast<object>();
1919
if (RunParallel)
2020
{
21-
return ExecutionResult.Branch(new List<object>(values), new IteratorPersistenceData() { ChildrenActive = true });
21+
return ExecutionResult.Branch(new List<object>(values), new IteratorPersistenceData { ChildrenActive = true });
2222
}
2323
else
2424
{
25-
return ExecutionResult.Branch(new List<object>(new object[] { values.ElementAt(0) }), new IteratorPersistenceData() { ChildrenActive = true });
25+
return ExecutionResult.Branch(new List<object>(new object[] { values.ElementAt(0) }), new IteratorPersistenceData { ChildrenActive = true });
2626
}
2727
}
2828

src/WorkflowCore/Primitives/If.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public override ExecutionResult Run(IStepExecutionContext context)
1515
{
1616
if (Condition)
1717
{
18-
return ExecutionResult.Branch(new List<object>() { context.Item }, new ControlPersistenceData() { ChildrenActive = true });
18+
return ExecutionResult.Branch(new List<object> { context.Item }, new ControlPersistenceData { ChildrenActive = true });
1919
}
2020

2121
return ExecutionResult.Next();

src/WorkflowCore/Primitives/OutcomeSwitch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public override ExecutionResult Run(IStepExecutionContext context)
1212
{
1313
if (context.PersistenceData == null)
1414
{
15-
var result = ExecutionResult.Branch(new List<object>() { context.Item }, new ControlPersistenceData() { ChildrenActive = true });
15+
var result = ExecutionResult.Branch(new List<object> { context.Item }, new ControlPersistenceData { ChildrenActive = true });
1616
result.OutcomeValue = GetPreviousOutcome(context);
1717
return result;
1818
}

src/WorkflowCore/Primitives/Recur.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ public override ExecutionResult Run(IStepExecutionContext context)
1818
return ExecutionResult.Next();
1919
}
2020

21-
return new ExecutionResult()
21+
return new ExecutionResult
2222
{
2323
Proceed = false,
24-
BranchValues = new List<object>() { null },
24+
BranchValues = new List<object> { null },
2525
SleepFor = Interval
2626
};
2727
}

src/WorkflowCore/Primitives/Schedule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ public override ExecutionResult Run(IStepExecutionContext context)
1313
{
1414
if (context.PersistenceData == null)
1515
{
16-
return ExecutionResult.Sleep(Interval, new SchedulePersistenceData() { Elapsed = false });
16+
return ExecutionResult.Sleep(Interval, new SchedulePersistenceData { Elapsed = false });
1717
}
1818

1919
if (context.PersistenceData is SchedulePersistenceData)
2020
{
2121
if (!((SchedulePersistenceData)context.PersistenceData).Elapsed)
2222
{
23-
return ExecutionResult.Branch(new List<object>() { context.Item }, new SchedulePersistenceData() { Elapsed = true });
23+
return ExecutionResult.Branch(new List<object> { context.Item }, new SchedulePersistenceData { Elapsed = true });
2424
}
2525

2626
if (context.Workflow.IsBranchComplete(context.ExecutionPointer.Id))

src/WorkflowCore/Primitives/Sequence.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public override ExecutionResult Run(IStepExecutionContext context)
1111
{
1212
if (context.PersistenceData == null)
1313
{
14-
return ExecutionResult.Branch(new List<object>() { context.Item }, new ControlPersistenceData() { ChildrenActive = true });
14+
return ExecutionResult.Branch(new List<object> { context.Item }, new ControlPersistenceData { ChildrenActive = true });
1515
}
1616

1717
if ((context.PersistenceData is ControlPersistenceData) && ((context.PersistenceData as ControlPersistenceData).ChildrenActive))

0 commit comments

Comments
 (0)