Skip to content

Commit

Permalink
Merge pull request #17 from marcwittke/hotfix/2.0.2
Browse files Browse the repository at this point in the history
r# greening
  • Loading branch information
marcwittke committed Feb 28, 2018
2 parents 77e34f9 + 9ecf838 commit dcaa149
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/Backend.Fx.Testing/PrivateSetterCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public static class PrivateSetterCaller

private static string GetName<T, TValue>(Expression<Func<T, TValue>> exp)
{
MemberExpression body = exp.Body as MemberExpression;

if (body == null)
if (!(exp.Body is MemberExpression body))
{
UnaryExpression ubody = (UnaryExpression)exp.Body;
body = ubody.Operand as MemberExpression;
Expand Down
3 changes: 1 addition & 2 deletions src/Backend.Fx/Extensions/StringEnumUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ public static class StringEnumUtil
{
public static TEnum Parse<TEnum>(this string value) where TEnum : struct
{
TEnum enumValue;
if(Enum.TryParse(value, out enumValue))
if(Enum.TryParse(value, out TEnum enumValue))
{
return enumValue;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Backend.Fx/RandomData/LinqExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public static T Random<T>(this IEnumerable<T> source)
throw new ArgumentNullException(nameof(source));
}

var sourceQueryable = source as IQueryable<T>;
if (sourceQueryable != null)
if (source is IQueryable<T> sourceQueryable)
{
int count = sourceQueryable.Count();
return sourceQueryable.Skip(TestRandom.Next(count - 1)).First();
Expand Down

0 comments on commit dcaa149

Please sign in to comment.