Skip to content

Commit 59e6f8c

Browse files
authored
leverage TryGetValue in ContextDictionary (#4549)
1 parent ab91a22 commit 59e6f8c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Source/Csla/Core/ContextDictionary.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ public class ContextDictionary : ConcurrentDictionary<object, object>, IContextD
2222
/// <inheritdoc cref="Csla.Core.IContextDictionary.GetValueOrNull(string)"/>
2323
public object GetValueOrNull(string key)
2424
{
25-
if (ContainsKey(key))
26-
return this[key];
27-
return null;
25+
TryGetValue(key, out var result);
26+
return result;
2827
}
2928

3029
#region IMobileObject Members

0 commit comments

Comments
 (0)