More strings to MongoIds
Convert constructors into primary constructors Simplified logic with use of ??, ??= and method groups Cleaned up redundant conditional access qualifiers
This commit is contained in:
@@ -25,9 +25,9 @@ public class InMemoryCacheService(ICloner cloner)
|
||||
/// <returns> Stored data </returns>
|
||||
public T? GetDataByKey<T>(string key)
|
||||
{
|
||||
if (_cacheData.ContainsKey(key))
|
||||
if (_cacheData.TryGetValue(key, out var value))
|
||||
{
|
||||
return (T)_cacheData[key];
|
||||
return (T)value;
|
||||
}
|
||||
|
||||
return default;
|
||||
|
||||
Reference in New Issue
Block a user