Use c#9 + namespace fix
This commit is contained in:
@@ -77,7 +77,7 @@ namespace Umbraco.Cms.Core
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(o is T value))
|
||||
if (o is not T value)
|
||||
{
|
||||
throw new ArgumentException($"Expected type {typeof(T).FullName}, got {o.GetType().FullName}", nameof(o));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Umbraco.Core.Security
|
||||
namespace Umbraco.Cms.Core.Security
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates and manages <see cref="IBackOfficeSecurity"/> instances.
|
||||
|
||||
@@ -2,13 +2,8 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>8</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Core</RootNamespace>
|
||||
<AssemblyVersion>0.5.0</AssemblyVersion>
|
||||
<InformationalVersion>0.5.0</InformationalVersion>
|
||||
<FileVersion>0.5.0</FileVersion>
|
||||
<Product>Umbraco CMS</Product>
|
||||
<RootNamespace>Umbraco.Core</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<RootNamespace>Umbraco.Cms.Infrastructure.Examine</RootNamespace>
|
||||
<Product>Umbraco CMS</Product>
|
||||
<RootNamespace>Umbraco.Examine</RootNamespace>
|
||||
<Title>Umbraco.Examine.Lucene</Title>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Sync;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Core.Security;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.HostedServices
|
||||
{
|
||||
|
||||
@@ -80,6 +80,7 @@ _hostingEnvironment = hostingEnvironment;
|
||||
{
|
||||
db = _dbFactory.CreateDatabase();
|
||||
|
||||
|
||||
_hasTable = db.HasTable(Cms.Core.Constants.DatabaseSchema.Tables.KeyValue);
|
||||
if (!_hasTable)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>8</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Infrastructure</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RootNamespace>Umbraco.Cms.Infrastructure.PublishedCache</RootNamespace>
|
||||
<LangVersion>8</LangVersion>
|
||||
<RootNamespace>Umbraco.Infrastructure.PublishedCache</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Tests.Common</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -14,9 +14,11 @@ using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Cache;
|
||||
using Umbraco.Cms.Core.Composing;
|
||||
using Umbraco.Cms.Core.DependencyInjection;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Cms.Tests.Common.Testing;
|
||||
using Umbraco.Cms.Tests.Integration.DependencyInjection;
|
||||
@@ -24,9 +26,7 @@ using Umbraco.Cms.Tests.Integration.Testing;
|
||||
using Umbraco.Cms.Web.BackOffice.Controllers;
|
||||
using Umbraco.Cms.Web.Common.Controllers;
|
||||
using Umbraco.Cms.Web.Website.Controllers;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Extensions;
|
||||
using Constants = Umbraco.Cms.Core.Constants;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Integration.TestServerTest
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Cms.Core.DependencyInjection;
|
||||
using Umbraco.Cms.Core.IO;
|
||||
using Umbraco.Cms.Core.Scoping;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
@@ -36,9 +37,7 @@ using Umbraco.Cms.Tests.Common.Testing;
|
||||
using Umbraco.Cms.Tests.Integration.DependencyInjection;
|
||||
using Umbraco.Cms.Tests.Integration.Extensions;
|
||||
using Umbraco.Cms.Tests.Integration.Implementations;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Extensions;
|
||||
using Constants = Umbraco.Cms.Core.Constants;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<LangVersion>8</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Tests.Integration</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ using Umbraco.Cms.Core.Mapping;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.PropertyEditors;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
@@ -24,7 +25,6 @@ using Umbraco.Cms.Tests.Common.Testing;
|
||||
using Umbraco.Cms.Tests.Integration.Testing;
|
||||
using Umbraco.Cms.Web.BackOffice.Filters;
|
||||
using Umbraco.Cms.Web.BackOffice.ModelBinders;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Extensions;
|
||||
using DataType = Umbraco.Cms.Core.Models.DataType;
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Cms.Core;
|
||||
using Umbraco.Cms.Core.Runtime;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Sync;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Cms.Infrastructure;
|
||||
using Umbraco.Cms.Infrastructure.HostedServices;
|
||||
using Umbraco.Core.Security;
|
||||
|
||||
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Infrastructure.HostedServices
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Web.BackOffice</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ using Umbraco.Cms.Web.Common.Routing;
|
||||
using Umbraco.Cms.Web.Common.Security;
|
||||
using Umbraco.Cms.Web.Common.Templates;
|
||||
using Umbraco.Cms.Web.Common.UmbracoContext;
|
||||
using Umbraco.Core.Security;
|
||||
using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment;
|
||||
|
||||
namespace Umbraco.Extensions
|
||||
|
||||
@@ -353,13 +353,12 @@ namespace Umbraco.Cms.Web.Common.Macros
|
||||
return Attempt.Fail(new MacroContent { Text = "[macro failed (no content)]" });
|
||||
}
|
||||
|
||||
ILocalizedTextService textService = _textService;
|
||||
|
||||
return ExecuteMacroWithErrorWrapper(model,
|
||||
$"Executing PartialView: MacroSource=\"{model.MacroSource}\".",
|
||||
"Executed PartialView.",
|
||||
() => _partialViewMacroEngine.Execute(model, content),
|
||||
() => textService.Localize("errors/macroErrorLoadingPartialView", new[] { model.MacroSource }));
|
||||
() => _textService.Localize("errors/macroErrorLoadingPartialView", new[] { model.MacroSource }));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
using Umbraco.Cms.Infrastructure.PublishedCache;
|
||||
using Umbraco.Cms.Web.Common.Profiler;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Web.Common.Middleware
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Umbraco.Cms.Core.Security;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Core.Security;
|
||||
|
||||
namespace Umbraco.Cms.Web.Common.Security
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Web.Common</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
23
src/Umbraco.Web.UI.NetCore/BergViewComponent.cs
Normal file
23
src/Umbraco.Web.UI.NetCore/BergViewComponent.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Cms.Core.Web;
|
||||
|
||||
namespace Umbraco.Cms.Web.UI.NetCore
|
||||
{
|
||||
public class BergViewComponent : ViewComponent
|
||||
{
|
||||
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
|
||||
|
||||
public BergViewComponent(IUmbracoContextAccessor umbracoContextAccessor)
|
||||
{
|
||||
_umbracoContextAccessor = umbracoContextAccessor;
|
||||
}
|
||||
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
TempData["BERG"] = "coool";
|
||||
|
||||
var currentPage = _umbracoContextAccessor.UmbracoContext.PublishedRequest?.PublishedContent;
|
||||
return View(currentPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace>Umbraco.Cms.Web.UI.NetCore</RootNamespace>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Web.UI.NetCore</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
@@ -22,7 +21,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Plugins" />
|
||||
<Folder Include="Views" />
|
||||
<Folder Include="wwwroot\Media" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<RootNamespace>Umbraco.Cms.Web.Website</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user