Skip to content

Commit

Permalink
update DynamoDBEntryConversion.TryFromEntry to make it more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammad-othman authored and ashovlin committed Jan 17, 2023
1 parent 338c7d3 commit 18ef731
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -571,14 +571,17 @@ public bool TryFromEntry(DynamoDBEntry entry, Type targetType, out object value)

var d = entry as Document;
if (d != null && TryFrom(d, targetType, out value))
return true;

value = null;

var n = entry as DynamoDBNull;
return true;

var n = entry as DynamoDBNull;
if (n != null)
return true;

{
value = null;
return true;
}

// Could not convert entry to a known type, setting value to null as it's an out parameter
value = null;
return false;
}

Expand Down

0 comments on commit 18ef731

Please sign in to comment.