Skip to content

Commit

Permalink
Fix DT.AzureStorage regression caused by new Generation property. (#712)
Browse files Browse the repository at this point in the history
Co-authored-by: amdeel <52223332+amdeel@users.noreply.github.com>
  • Loading branch information
cgillum and amdeel authored Apr 20, 2022
1 parent 5730614 commit 786308f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ public async Task CreateTaskOrchestrationAsync(TaskMessage creationMessage, Orch
}
else
{
executionStartedEvent.Generation = 1;
executionStartedEvent.Generation = 0;
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/DurableTask.AzureStorage/Tracking/TableEntityConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,38 +164,38 @@ static List<PropertyConverter> GetPropertyConvertersForType(Type type)
{
if (property != null)
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForInt((int)property.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForInt((int?)property.GetValue(o));
setObjectPropertyFunc = (o, e) => property.SetValue(o, e.Int32Value);
}
else
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForInt((int)field.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForInt((int?)field.GetValue(o));
setObjectPropertyFunc = (o, e) => field.SetValue(o, e.Int32Value);
}
}
else if (typeof(long?).IsAssignableFrom(memberValueType))
{
if (property != null)
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForLong((long)property.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForLong((long?)property.GetValue(o));
setObjectPropertyFunc = (o, e) => property.SetValue(o, e.Int64Value);
}
else
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForLong((long)field.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForLong((long?)field.GetValue(o));
setObjectPropertyFunc = (o, e) => field.SetValue(o, e.Int64Value);
}
}
else if (typeof(bool?).IsAssignableFrom(memberValueType))
{
if (property != null)
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForBool((bool)property.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForBool((bool?)property.GetValue(o));
setObjectPropertyFunc = (o, e) => property.SetValue(o, e.BooleanValue);
}
else
{
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForBool((bool)field.GetValue(o));
getEntityPropertyFunc = o => EntityProperty.GeneratePropertyForBool((bool?)field.GetValue(o));
setObjectPropertyFunc = (o, e) => field.SetValue(o, e.BooleanValue);
}
}
Expand Down

0 comments on commit 786308f

Please sign in to comment.