From 8f0ac61634332ecfd0dfe1ba38ae8765a5595f2e Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 26 Apr 2022 03:28:49 +0200 Subject: [PATCH] Refactoring: Extract Safe module to Abstractions (#3676) So that it can be used by plugins as well. --- BTCPayServer.Abstractions/BTCPayServer.Abstractions.csproj | 1 + {BTCPayServer => BTCPayServer.Abstractions}/Services/Safe.cs | 2 +- BTCPayServer/TagHelpers/SrvModel.cs | 1 + BTCPayServer/_ViewImports.cshtml | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) rename {BTCPayServer => BTCPayServer.Abstractions}/Services/Safe.cs (94%) diff --git a/BTCPayServer.Abstractions/BTCPayServer.Abstractions.csproj b/BTCPayServer.Abstractions/BTCPayServer.Abstractions.csproj index 1f2fe04d6..945aece74 100644 --- a/BTCPayServer.Abstractions/BTCPayServer.Abstractions.csproj +++ b/BTCPayServer.Abstractions/BTCPayServer.Abstractions.csproj @@ -31,6 +31,7 @@ + diff --git a/BTCPayServer/Services/Safe.cs b/BTCPayServer.Abstractions/Services/Safe.cs similarity index 94% rename from BTCPayServer/Services/Safe.cs rename to BTCPayServer.Abstractions/Services/Safe.cs index f595b72d1..8ddb7b9a4 100644 --- a/BTCPayServer/Services/Safe.cs +++ b/BTCPayServer.Abstractions/Services/Safe.cs @@ -2,7 +2,7 @@ using Ganss.XSS; using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.Rendering; -namespace BTCPayServer.Services +namespace BTCPayServer.Abstractions.Services { public class Safe { diff --git a/BTCPayServer/TagHelpers/SrvModel.cs b/BTCPayServer/TagHelpers/SrvModel.cs index e621db98a..aa2a31d00 100644 --- a/BTCPayServer/TagHelpers/SrvModel.cs +++ b/BTCPayServer/TagHelpers/SrvModel.cs @@ -1,3 +1,4 @@ +using BTCPayServer.Abstractions.Services; using BTCPayServer.Security; using BTCPayServer.Services; using Microsoft.AspNetCore.Razor.TagHelpers; diff --git a/BTCPayServer/_ViewImports.cshtml b/BTCPayServer/_ViewImports.cshtml index 2fea7a7df..d01ea8212 100644 --- a/BTCPayServer/_ViewImports.cshtml +++ b/BTCPayServer/_ViewImports.cshtml @@ -1,5 +1,6 @@ @using Microsoft.AspNetCore.Identity @using BTCPayServer +@using BTCPayServer.Abstractions.Services @using BTCPayServer.Views @using BTCPayServer.Models @using BTCPayServer.Models.AccountViewModels @@ -8,7 +9,7 @@ @using BTCPayServer.Models.StoreViewModels @using BTCPayServer.Data @using Microsoft.AspNetCore.Routing; -@inject BTCPayServer.Services.Safe Safe +@inject Safe Safe @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, BTCPayServer @addTagHelper *, BundlerMinifier.TagHelpers