Skip to content

Commit 290b9db

Browse files
committed
Fixing points from the code review
1 parent 9e19e53 commit 290b9db

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Source/Kernel/Projections.Specs/for_KeyResolvers/when_identifying_read_model_key_from_parent_hierarchy_with_empty_string_children_property_path.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class when_identifying_read_model_key_from_parent_hierarchy_with_empty_st
2424
ISink _sink;
2525
KeyResolvers _keyResolvers;
2626

27-
static EventType _parentEventType = new("5f4f4368-6989-4d9d-a84e-7393e0b41cfd", 1);
28-
static EventType _childEventType = new("02405794-91e7-4e4f-8ad1-f043070ca297", 1);
27+
static readonly EventType _parentEventType = new("5f4f4368-6989-4d9d-a84e-7393e0b41cfd", 1);
28+
static readonly EventType _childEventType = new("02405794-91e7-4e4f-8ad1-f043070ca297", 1);
2929
const string RootKey = "root-key-123";
3030
const string ParentKey = "parent-key-456";
3131
const string ChildKey = "child-key-789";

Source/Kernel/Storage.MongoDB/BsonValueExtensions.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,9 @@ public static BsonValue ToBsonValue(this object? input, Type? targetType = defau
206206
return new TimeOnly(dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Millisecond);
207207
}
208208

209-
if (targetType == typeof(TimeSpan))
209+
if (targetType == typeof(TimeSpan) && value is BsonString bsonTimeStampString)
210210
{
211-
if (value is BsonString bsonString)
212-
{
213-
return TimeSpan.Parse(bsonString.Value);
214-
}
211+
return TimeSpan.Parse(bsonTimeStampString.Value);
215212
}
216213

217214
return null;

0 commit comments

Comments
 (0)