Using expression-bodies methods
This commit is contained in:
parent
41fe215027
commit
91b3ea4547
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue