Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored May 31, 2024
1 parent f137b05 commit b8bdcd6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ namespace OrchardCore.Settings;

public static class SiteServiceExtensions
{
/// <summary>
/// Gets an instance of the specified settings if it exists.
/// </summary>
/// <typeparam name="T">The type of the settings to attempt to get.</typeparam>
/// <param name="siteService">The site service.</param>
/// <returns>An instance of the given type if one exists.</returns>
public static async Task<T> GetSettingsAsync<T>(this ISiteService siteService) where T : new()
=> (await siteService.GetSiteSettingsAsync()).As<T>();
}

0 comments on commit b8bdcd6

Please sign in to comment.