Skip to content

Commit 6a8879a

Browse files
author
Sébastien Geiser
committed
Refactore and clean
1 parent 8d61ee7 commit 6a8879a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

CodingSeb.ExpressionEvaluator.Tests/ExpressionEvaluatorTests.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,12 +1971,9 @@ public object EvaluateWithSpecificEvaluator(ExpressionEvaluator evaluator, strin
19711971
{
19721972
return evaluator.Evaluate(expression);
19731973
}
1974-
catch (Exception exception)
1974+
catch (Exception exception) when (inCaseOfException != null)
19751975
{
1976-
if (inCaseOfException == null)
1977-
throw;
1978-
else
1979-
return inCaseOfException(exception);
1976+
return inCaseOfException(exception);
19801977
}
19811978
}
19821979

CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ public static void ClearAllCaches()
454454

455455
private static IList<Assembly> staticAssemblies;
456456
private IList<Assembly> assemblies;
457-
457+
458458
/// <summary>
459459
/// All assemblies needed to resolves Types
460460
/// by default all Assemblies loaded in the current AppDomain
@@ -3154,7 +3154,7 @@ protected virtual Type GetTypeByFriendlyName(string typeName, string genericType
31543154

31553155
if (result == null)
31563156
{
3157-
result = Types.ToList().Find(type => type.Name.Equals(typeName, StringComparisonForCasing));
3157+
result = Types.ToList().Find(type => type.Name.Equals(typeName, StringComparisonForCasing) || type.FullName.StartsWith(typeName + ","));
31583158
}
31593159

31603160
for (int a = 0; a < Assemblies.Count && result == null; a++)

0 commit comments

Comments
 (0)