Using expression-bodies methods
This commit is contained in:
parent
41fe215027
commit
91b3ea4547
|
|
@ -16,9 +16,6 @@ namespace Microsoft.AspNet.Localization
|
|||
_strategy = strategy;
|
||||
}
|
||||
|
||||
public RequestCulture DetermineRequestCulture([NotNull] HttpContext httpContext)
|
||||
{
|
||||
return _strategy(httpContext);
|
||||
}
|
||||
public RequestCulture DetermineRequestCulture([NotNull] HttpContext httpContext) => _strategy(httpContext);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@ namespace Microsoft.AspNet.Builder
|
|||
/// <returns>The <see cref="IApplicationBuilder"/>.</returns>
|
||||
public static IApplicationBuilder UseRequestLocalization(
|
||||
[NotNull] this IApplicationBuilder builder,
|
||||
[NotNull] RequestLocalizationMiddlewareOptions options)
|
||||
{
|
||||
return builder.UseMiddleware<RequestLocalizationMiddleware>(options);
|
||||
}
|
||||
[NotNull] RequestLocalizationMiddlewareOptions options) => 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.
|
||||
/// </summary>
|
||||
/// <returns>The <see cref="IEnumerator{LocalizedString}"/>.</returns>
|
||||
public virtual IEnumerator<LocalizedString> GetEnumerator()
|
||||
{
|
||||
return GetEnumerator(CultureInfo.CurrentUICulture);
|
||||
}
|
||||
public virtual IEnumerator<LocalizedString> GetEnumerator() => GetEnumerator(CultureInfo.CurrentUICulture);
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
/// <summary>
|
||||
/// 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 bool Equals(MissingManifestCacheKey other)
|
||||
{
|
||||
return string.Equals(Name, other.Name, StringComparison.Ordinal)
|
||||
&& CultureInfo == other.CultureInfo;
|
||||
}
|
||||
public bool Equals(MissingManifestCacheKey other) =>
|
||||
string.Equals(Name, other.Name, StringComparison.Ordinal) && CultureInfo == other.CultureInfo;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
|
|
@ -218,10 +209,7 @@ namespace Microsoft.Framework.Localization
|
|||
return base.Equals(obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _hashCode;
|
||||
}
|
||||
public override int GetHashCode() => _hashCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -57,9 +57,6 @@ namespace Microsoft.Framework.Localization
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override IEnumerator<LocalizedString> GetEnumerator()
|
||||
{
|
||||
return GetEnumerator(_culture);
|
||||
}
|
||||
public override IEnumerator<LocalizedString> GetEnumerator() => GetEnumerator(_culture);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue