Using expression-bodies methods

This commit is contained in:
Hisham Abdullah Bin Ateya 2015-05-08 01:52:03 +03:00
parent 41fe215027
commit 91b3ea4547
4 changed files with 8 additions and 29 deletions

View File

@ -16,9 +16,6 @@ namespace Microsoft.AspNet.Localization
_strategy = strategy; _strategy = strategy;
} }
public RequestCulture DetermineRequestCulture([NotNull] HttpContext httpContext) public RequestCulture DetermineRequestCulture([NotNull] HttpContext httpContext) => _strategy(httpContext);
{
return _strategy(httpContext);
}
} }
} }

View File

@ -33,9 +33,6 @@ namespace Microsoft.AspNet.Builder
/// <returns>The <see cref="IApplicationBuilder"/>.</returns> /// <returns>The <see cref="IApplicationBuilder"/>.</returns>
public static IApplicationBuilder UseRequestLocalization( public static IApplicationBuilder UseRequestLocalization(
[NotNull] this IApplicationBuilder builder, [NotNull] this IApplicationBuilder builder,
[NotNull] RequestLocalizationMiddlewareOptions options) [NotNull] RequestLocalizationMiddlewareOptions options) => builder.UseMiddleware<RequestLocalizationMiddleware>(options);
{
return builder.UseMiddleware<RequestLocalizationMiddleware>(options);
}
} }
} }

View File

@ -119,15 +119,9 @@ namespace Microsoft.Framework.Localization
/// Returns an <see cref="IEnumerator{LocalizedString}"/> for all strings in the current culture. /// Returns an <see cref="IEnumerator{LocalizedString}"/> for all strings in the current culture.
/// </summary> /// </summary>
/// <returns>The <see cref="IEnumerator{LocalizedString}"/>.</returns> /// <returns>The <see cref="IEnumerator{LocalizedString}"/>.</returns>
public virtual IEnumerator<LocalizedString> GetEnumerator() public virtual IEnumerator<LocalizedString> GetEnumerator() => GetEnumerator(CultureInfo.CurrentUICulture);
{
return GetEnumerator(CultureInfo.CurrentUICulture);
}
IEnumerator IEnumerable.GetEnumerator() IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
{
return GetEnumerator();
}
/// <summary> /// <summary>
/// Returns an <see cref="IEnumerator{LocalizedString}"/> for all strings in the specified culture. /// Returns an <see cref="IEnumerator{LocalizedString}"/> for all strings in the specified culture.
@ -200,11 +194,8 @@ namespace Microsoft.Framework.Localization
public CultureInfo CultureInfo { get; } public CultureInfo CultureInfo { get; }
public bool Equals(MissingManifestCacheKey other) public bool Equals(MissingManifestCacheKey other) =>
{ string.Equals(Name, other.Name, StringComparison.Ordinal) && CultureInfo == other.CultureInfo;
return string.Equals(Name, other.Name, StringComparison.Ordinal)
&& CultureInfo == other.CultureInfo;
}
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
@ -218,10 +209,7 @@ namespace Microsoft.Framework.Localization
return base.Equals(obj); return base.Equals(obj);
} }
public override int GetHashCode() public override int GetHashCode() => _hashCode;
{
return _hashCode;
}
} }
} }
} }

View File

@ -57,9 +57,6 @@ namespace Microsoft.Framework.Localization
} }
/// <inheritdoc /> /// <inheritdoc />
public override IEnumerator<LocalizedString> GetEnumerator() public override IEnumerator<LocalizedString> GetEnumerator() => GetEnumerator(_culture);
{
return GetEnumerator(_culture);
}
} }
} }