Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: use standard ASPNET Core namespace for extensions #6

Merged
merged 4 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .azuredevops/pipelines/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ stages:
variables:
- group: Code Sign KV Auth

- name: Configuration
value: Release
- name: ProjectFolder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in indentation has broke the azure pipeline.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed in #5

value: src/Kentico.Xperience.MiniProfiler

- name: ProjectPath
- name: ProjectFilePath
value: src/Kentico.Xperience.MiniProfiler/Kentico.Xperience.MiniProfiler.csproj

steps:
Expand All @@ -63,17 +63,17 @@ stages:
displayName: Restore dependencies
inputs:
command: restore
projects: ${{ variables.ProjectPath }}
projects: ${{ variables.ProjectFilePath }}
feedsToUse: select
restoreArguments: --locked-mode

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: ${{ variables.ProjectPath }}
projects: ${{ variables.ProjectFilePath }}
configuration: ${{ variables.Configuration }}
arguments: --no-restore
arguments: --no-restore --verbosity Detailed
env:
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<CopyDocumentationFilesFromPackages>true</CopyDocumentationFilesFromPackages>
<CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
<NoWarn>$(NoWarn);1591</NoWarn>
<RootNamespace>Kentico.Xperience.RepoTemplate</RootNamespace>

<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<TimestampServerUrl>http://timestamp.digicert.com</TimestampServerUrl>
Expand Down
19 changes: 0 additions & 19 deletions Kentico.Xperience.RepoTemplate.sln

This file was deleted.

1 change: 0 additions & 1 deletion examples/DancingGoat/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Kentico.PageBuilder.Web.Mvc;
using Kentico.OnlineMarketing.Web.Mvc;
using Kentico.Activities.Web.Mvc;
using Kentico.Xperience.MiniProfiler;

var builder = WebApplication.CreateBuilder(args);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
using CMS.DataEngine;
using Kentico.Xperience.MiniProfiler;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.Extensions.DependencyInjection;
using StackExchange.Profiling;

namespace Kentico.Xperience.MiniProfiler;
namespace Microsoft.Extensions.DependencyInjection;

public static class MiniProfilerServiceCollectionExtensions
{
/// <summary>
/// Adds Xperience dependencies for MiniProfiler integration, setting required options for MiniProfiler
/// </summary>
/// <param name="services"></param>
/// <returns></returns>
public static IServiceCollection AddKenticoMiniProfiler(this IServiceCollection services)
{
services.AddMiniProfiler(options =>
Expand All @@ -15,4 +21,23 @@ public static IServiceCollection AddKenticoMiniProfiler(this IServiceCollection

return services;
}

/// <summary>
/// Adds Xperience dependencies for MiniProfiler, enabling customization of MiniProfiler and setting required options
/// </summary>
/// <param name="services"></param>
/// <param name="configureOptions"></param>
/// <returns></returns>
public static IServiceCollection AddKenticoMiniProfiler(this IServiceCollection services, Action<MiniProfilerOptions> configureOptions)
{
services.AddMiniProfiler(options =>
{
configureOptions(options);
options.TrackConnectionOpenClose = true;
});
services.AddTransient<ITagHelperComponent, ScriptTagComponent>();
services.AddTransient<IDataProvider, MiniprofilerDataProvider>();

return services;
}
}
Loading