Skip to content

Commit

Permalink
Up Bump .NET SDK from 5.0.100 to 5.0.102
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Jan 14, 2021
1 parent 92aad1a commit 7c73448
Show file tree
Hide file tree
Showing 33 changed files with 167 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ private static bool HasAuthorizationRequirement(
{
foreach (var authorizationRequirement in authorizationRequirements)
{
if (authorizationRequirement is ClaimsAuthorizationRequirement ||
authorizationRequirement is NameAuthorizationRequirement ||
authorizationRequirement is OperationAuthorizationRequirement ||
authorizationRequirement is RolesAuthorizationRequirement ||
authorizationRequirement is AssertionRequirement)
if (authorizationRequirement is ClaimsAuthorizationRequirement or
NameAuthorizationRequirement or
OperationAuthorizationRequirement or
RolesAuthorizationRequirement or
AssertionRequirement)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,17 @@ internal static class DayOfWeekExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="DayOfWeek" />.
/// </returns>
public static string ToLowercaseString(this DayOfWeek dayOfWeek)
{
switch (dayOfWeek)
public static string ToLowercaseString(this DayOfWeek dayOfWeek) =>
dayOfWeek switch
{
case DayOfWeek.Friday:
return "friday";
case DayOfWeek.Monday:
return "monday";
case DayOfWeek.Saturday:
return "saturday";
case DayOfWeek.Sunday:
return "sunday";
case DayOfWeek.Thursday:
return "thursday";
case DayOfWeek.Tuesday:
return "tuesday";
case DayOfWeek.Wednesday:
return "wednesday";
default:
return string.Empty;
}
}
DayOfWeek.Friday => "friday",
DayOfWeek.Monday => "monday",
DayOfWeek.Saturday => "saturday",
DayOfWeek.Sunday => "sunday",
DayOfWeek.Thursday => "thursday",
DayOfWeek.Tuesday => "tuesday",
DayOfWeek.Wednesday => "wednesday",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ internal static class OpenGraphAgeGroupExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphAgeGroup" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphAgeGroup openGraphAgeGroup)
{
switch (openGraphAgeGroup)
public static string ToLowercaseString(this OpenGraphAgeGroup openGraphAgeGroup) =>
openGraphAgeGroup switch
{
case OpenGraphAgeGroup.Adult:
return "adult";
case OpenGraphAgeGroup.Kids:
return "kids";
default:
return string.Empty;
}
}
OpenGraphAgeGroup.Adult => "adult",
OpenGraphAgeGroup.Kids => "kids",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ internal static class OpenGraphAvailabilityExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphAvailability" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphAvailability openGraphAvailability)
{
switch (openGraphAvailability)
public static string ToLowercaseString(this OpenGraphAvailability openGraphAvailability) =>
openGraphAvailability switch
{
case OpenGraphAvailability.InStock:
return "instock";
case OpenGraphAvailability.OutOfStock:
return "oos";
case OpenGraphAvailability.Pending:
return "pending";
default:
return string.Empty;
}
}
OpenGraphAvailability.InStock => "instock",
OpenGraphAvailability.OutOfStock => "oos",
OpenGraphAvailability.Pending => "pending",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ internal static class OpenGraphConditionExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphCondition" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphCondition openGraphCondition)
{
switch (openGraphCondition)
public static string ToLowercaseString(this OpenGraphCondition openGraphCondition) =>
openGraphCondition switch
{
case OpenGraphCondition.New:
return "new";
case OpenGraphCondition.Refurbished:
return "refurbished";
case OpenGraphCondition.Used:
return "used";
default:
return string.Empty;
}
}
OpenGraphCondition.New => "new",
OpenGraphCondition.Refurbished => "refurbished",
OpenGraphCondition.Used => "used",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,15 @@ internal static class OpenGraphDeterminerExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphDeterminer" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphDeterminer determiner)
{
switch (determiner)
public static string ToLowercaseString(this OpenGraphDeterminer determiner) =>
determiner switch
{
case OpenGraphDeterminer.A:
return "a";
case OpenGraphDeterminer.An:
return "an";
case OpenGraphDeterminer.Auto:
return "auto";
case OpenGraphDeterminer.The:
return "the";
case OpenGraphDeterminer.Blank:
default:
return string.Empty;
}
}
OpenGraphDeterminer.A => "a",
OpenGraphDeterminer.An => "an",
OpenGraphDeterminer.Auto => "auto",
OpenGraphDeterminer.The => "the",
OpenGraphDeterminer.Blank => string.Empty,
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@ internal static class OpenGraphGenderExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphGender" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphGender gender)
{
switch (gender)
public static string ToLowercaseString(this OpenGraphGender gender) =>
gender switch
{
case OpenGraphGender.Male:
return "male";
case OpenGraphGender.Female:
return "female";
default:
return string.Empty;
}
}
OpenGraphGender.Male => "male",
OpenGraphGender.Female => "female",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ internal static class OpenGraphMusicReleaseTypeExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphMusicReleaseType" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphMusicReleaseType musicReleaseType)
{
switch (musicReleaseType)
public static string ToLowercaseString(this OpenGraphMusicReleaseType musicReleaseType) =>
musicReleaseType switch
{
case OpenGraphMusicReleaseType.OriginalRelease:
return "original_release";
case OpenGraphMusicReleaseType.ReRelease:
return "re_release";
case OpenGraphMusicReleaseType.Anthology:
return "anthology";
default:
return string.Empty;
}
}
OpenGraphMusicReleaseType.OriginalRelease => "original_release",
OpenGraphMusicReleaseType.ReRelease => "re_release",
OpenGraphMusicReleaseType.Anthology => "anthology",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ internal static class OpenGraphTargetGenderExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="OpenGraphTargetGender" />.
/// </returns>
public static string ToLowercaseString(this OpenGraphTargetGender gender)
{
switch (gender)
public static string ToLowercaseString(this OpenGraphTargetGender gender) =>
gender switch
{
case OpenGraphTargetGender.Male:
return "male";
case OpenGraphTargetGender.Female:
return "female";
case OpenGraphTargetGender.Unisex:
return "unisex";
default:
return string.Empty;
}
}
OpenGraphTargetGender.Male => "male",
OpenGraphTargetGender.Female => "female",
OpenGraphTargetGender.Unisex => "unisex",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,36 @@ internal static class OpenGraphTypeExtensions
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The lower-case <see cref="string"/> representation of the <see cref="OpenGraphType"/>.</returns>
public static string ToLowercaseString(this OpenGraphType type)
{
switch (type)
public static string ToLowercaseString(this OpenGraphType type) =>
type switch
{
case OpenGraphType.Article:
return "article";
case OpenGraphType.Book:
return "book";
case OpenGraphType.BooksAuthor:
return "books.author";
case OpenGraphType.BooksBook:
return "books.book";
case OpenGraphType.BooksGenre:
return "books.genre";
case OpenGraphType.Business:
return "business.business";
case OpenGraphType.FitnessCourse:
return "fitness.course";
case OpenGraphType.GameAchievement:
return "game.achievement";
case OpenGraphType.MusicAlbum:
return "music.album";
case OpenGraphType.MusicPlaylist:
return "music.playlist";
case OpenGraphType.MusicRadioStation:
return "music.radio_station";
case OpenGraphType.MusicSong:
return "music.song";
case OpenGraphType.Place:
return "place";
case OpenGraphType.Product:
return "product";
case OpenGraphType.ProductGroup:
return "product.group";
case OpenGraphType.ProductItem:
return "product.item";
case OpenGraphType.Profile:
return "profile";
case OpenGraphType.RestaurantMenu:
return "restaurant.menu";
case OpenGraphType.RestaurantMenuItem:
return "restaurant.menu_item";
case OpenGraphType.RestaurantMenuSection:
return "restaurant.menu_section";
case OpenGraphType.Restaurant:
return "restaurant.restaurant";
case OpenGraphType.VideoEpisode:
return "video.episode";
case OpenGraphType.VideoMovie:
return "video.movie";
case OpenGraphType.VideoOther:
return "video.other";
case OpenGraphType.VideoTvShow:
return "video.tv_show";
case OpenGraphType.Website:
default:
return "website";
}
}
OpenGraphType.Article => "article",
OpenGraphType.Book => "book",
OpenGraphType.BooksAuthor => "books.author",
OpenGraphType.BooksBook => "books.book",
OpenGraphType.BooksGenre => "books.genre",
OpenGraphType.Business => "business.business",
OpenGraphType.FitnessCourse => "fitness.course",
OpenGraphType.GameAchievement => "game.achievement",
OpenGraphType.MusicAlbum => "music.album",
OpenGraphType.MusicPlaylist => "music.playlist",
OpenGraphType.MusicRadioStation => "music.radio_station",
OpenGraphType.MusicSong => "music.song",
OpenGraphType.Place => "place",
OpenGraphType.Product => "product",
OpenGraphType.ProductGroup => "product.group",
OpenGraphType.ProductItem => "product.item",
OpenGraphType.Profile => "profile",
OpenGraphType.RestaurantMenu => "restaurant.menu",
OpenGraphType.RestaurantMenuItem => "restaurant.menu_item",
OpenGraphType.RestaurantMenuSection => "restaurant.menu_section",
OpenGraphType.Restaurant => "restaurant.restaurant",
OpenGraphType.VideoEpisode => "video.episode",
OpenGraphType.VideoMovie => "video.movie",
OpenGraphType.VideoOther => "video.other",
OpenGraphType.VideoTvShow => "video.tv_show",
OpenGraphType.Website => "website",
_ => "website",
};
}
}
26 changes: 9 additions & 17 deletions Source/Boxed.AspNetCore.TagHelpers/ReferrerModeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,15 @@ internal static class ReferrerModeExtensions
/// <returns>
/// The lower-case <see cref="string" /> representation of the <see cref="ReferrerMode" />.
/// </returns>
public static string ToLowercaseString(this ReferrerMode referrerMode)
{
switch (referrerMode)
public static string ToLowercaseString(this ReferrerMode referrerMode) =>
referrerMode switch
{
case ReferrerMode.None:
return "none";
case ReferrerMode.NoneWhenDowngrade:
return "none-when-downgrade";
case ReferrerMode.Origin:
return "origin";
case ReferrerMode.OriginWhenCrossOrigin:
return "origin-when-crossorigin";
case ReferrerMode.UnsafeUrl:
return "unsafe-url";
default:
return string.Empty;
}
}
ReferrerMode.None => "none",
ReferrerMode.NoneWhenDowngrade => "none-when-downgrade",
ReferrerMode.Origin => "origin",
ReferrerMode.OriginWhenCrossOrigin => "origin-when-crossorigin",
ReferrerMode.UnsafeUrl => "unsafe-url",
_ => string.Empty,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace Boxed.AspNetCore.TagHelpers
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Hosting;

/// <inheritdoc />
[HtmlTargetElement(Attributes = SrcAttributeName + "," + SubresourceIntegritySrcAttributeName)]
Expand Down
Loading

0 comments on commit 7c73448

Please sign in to comment.