Remove obsolete PublishedContentQuery constructor
This commit is contained in:
@@ -7,6 +7,8 @@ using Umbraco.Web;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Tests.Testing;
|
||||
using Umbraco.Web.Composing;
|
||||
using Moq;
|
||||
using Examine;
|
||||
|
||||
namespace Umbraco.Tests.PublishedContent
|
||||
{
|
||||
@@ -201,7 +203,8 @@ namespace Umbraco.Tests.PublishedContent
|
||||
[Test]
|
||||
public void PublishedContentQueryTypedContentList()
|
||||
{
|
||||
var query = new PublishedContentQuery(Current.UmbracoContext.PublishedSnapshot, Current.UmbracoContext.VariationContextAccessor);
|
||||
var examineManager = new Mock<IExamineManager>();
|
||||
var query = new PublishedContentQuery(Current.UmbracoContext.PublishedSnapshot, Current.UmbracoContext.VariationContextAccessor, examineManager.Object);
|
||||
var result = query.Content(new[] { 1, 2, 4 }).ToArray();
|
||||
Assert.AreEqual(2, result.Length);
|
||||
Assert.AreEqual(1, result[0].Id);
|
||||
|
||||
@@ -22,12 +22,6 @@ namespace Umbraco.Web
|
||||
private readonly IVariationContextAccessor _variationContextAccessor;
|
||||
private readonly IExamineManager _examineManager;
|
||||
|
||||
[Obsolete("Use the constructor with all parameters instead")]
|
||||
public PublishedContentQuery(IPublishedSnapshot publishedSnapshot, IVariationContextAccessor variationContextAccessor)
|
||||
: this (publishedSnapshot, variationContextAccessor, ExamineManager.Instance)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PublishedContentQuery"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Examine;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
@@ -16,12 +17,14 @@ namespace Umbraco.Web.Routing
|
||||
private readonly ILogger _logger;
|
||||
private readonly IEntityService _entityService;
|
||||
private readonly IContentSection _contentConfigSection;
|
||||
private readonly IExamineManager _examineManager;
|
||||
|
||||
public ContentFinderByConfigured404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection)
|
||||
public ContentFinderByConfigured404(ILogger logger, IEntityService entityService, IContentSection contentConfigSection, IExamineManager examineManager)
|
||||
{
|
||||
_logger = logger;
|
||||
_entityService = entityService;
|
||||
_contentConfigSection = contentConfigSection;
|
||||
_examineManager = examineManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -62,7 +65,7 @@ namespace Umbraco.Web.Routing
|
||||
var error404 = NotFoundHandlerHelper.GetCurrentNotFoundPageId(
|
||||
_contentConfigSection.Error404Collection.ToArray(),
|
||||
_entityService,
|
||||
new PublishedContentQuery(frequest.UmbracoContext.PublishedSnapshot, frequest.UmbracoContext.VariationContextAccessor),
|
||||
new PublishedContentQuery(frequest.UmbracoContext.PublishedSnapshot, frequest.UmbracoContext.VariationContextAccessor, _examineManager),
|
||||
errorCulture);
|
||||
|
||||
IPublishedContent content = null;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Umbraco.Web.Runtime
|
||||
composition.Register<IPublishedContentQuery>(factory =>
|
||||
{
|
||||
var umbCtx = factory.GetInstance<IUmbracoContextAccessor>();
|
||||
return new PublishedContentQuery(umbCtx.UmbracoContext.PublishedSnapshot, factory.GetInstance<IVariationContextAccessor>());
|
||||
return new PublishedContentQuery(umbCtx.UmbracoContext.PublishedSnapshot, factory.GetInstance<IVariationContextAccessor>(), factory.GetInstance<IExamineManager>());
|
||||
}, Lifetime.Request);
|
||||
composition.Register<ITagQuery, TagQuery>(Lifetime.Request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user