diff --git a/src/Umbraco.Tests/MockTests.cs b/src/Umbraco.Tests/MockTests.cs index ba9ee113e3..f42f135dee 100644 --- a/src/Umbraco.Tests/MockTests.cs +++ b/src/Umbraco.Tests/MockTests.cs @@ -146,7 +146,7 @@ namespace Umbraco.Tests var helper = new UmbracoHelper(umbCtx, Mock.Of(), - Mock.Of(), + Mock.Of(), Mock.Of(), Mock.Of(), new UrlProvider(umbCtx, new[] {Mock.Of()}, UrlProviderMode.Auto), Mock.Of(), @@ -182,7 +182,7 @@ namespace Umbraco.Tests var helper = new UmbracoHelper(umbCtx, Mock.Of(), - Mock.Of(), + Mock.Of(), Mock.Of(), Mock.Of(), new UrlProvider(umbCtx, new[] diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs index 2a4da4dbc4..356b1076c7 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentMoreTests.cs @@ -188,7 +188,7 @@ namespace Umbraco.Tests.PublishedContent public void PublishedContentQueryTypedContentList() { var query = new PublishedContentQuery(UmbracoContext.Current.ContentCache, UmbracoContext.Current.MediaCache); - var result = query.TypedContent(new[] { 1, 2, 4 }).ToArray(); + var result = query.Content(new[] { 1, 2, 4 }).ToArray(); Assert.AreEqual(2, result.Length); Assert.AreEqual(1, result[0].Id); Assert.AreEqual(2, result[1].Id); diff --git a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs index 5fadc27d66..040ddc0abb 100644 --- a/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs +++ b/src/Umbraco.Tests/Web/Mvc/SurfaceControllerTests.cs @@ -132,7 +132,7 @@ namespace Umbraco.Tests.Web.Mvc var helper = new UmbracoHelper( umbCtx, Mock.Of(), - Mock.Of(query => query.TypedContent(It.IsAny()) == + Mock.Of(query => query.Content(It.IsAny()) == //return mock of IPublishedContent for any call to GetById Mock.Of(content => content.Id == 2)), Mock.Of(), @@ -223,7 +223,7 @@ namespace Umbraco.Tests.Web.Mvc public ActionResult GetContent(int id) { - var content = Umbraco.TypedContent(id); + var content = Umbraco.Content(id); return new PublishedContentResult(content); } diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index da00a4c2e9..da964c576f 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -171,7 +171,7 @@ namespace Umbraco.Web.Editors var q = ParseXPathQuery(query, nodeContextId); - var node = Umbraco.TypedContentSingleAtXPath(q); + var node = Umbraco.ContentSingleAtXPath(q); if (node == null) return null; @@ -190,7 +190,7 @@ namespace Umbraco.Web.Editors var ent = Services.EntityService.Get(nodeid); return ent.Path.Split(',').Reverse(); }, - publishedContentExists: i => Umbraco.TypedContent(i) != null); + publishedContentExists: i => Umbraco.Content(i) != null); } public EntityBasic GetById(int id, UmbracoEntityTypes type) diff --git a/src/Umbraco.Web/Editors/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQueryController.cs index f9c7fca7ce..913684da0e 100644 --- a/src/Umbraco.Web/Editors/TemplateQueryController.cs +++ b/src/Umbraco.Web/Editors/TemplateQueryController.cs @@ -71,7 +71,7 @@ namespace Umbraco.Web.Editors timer.Start(); - var currentPage = umbraco.TypedContentAtRoot().FirstOrDefault(); + var currentPage = umbraco.ContentAtRoot().FirstOrDefault(); timer.Stop(); @@ -80,7 +80,7 @@ namespace Umbraco.Web.Editors // adjust the "FROM" if (model != null && model.Source.Id > 0) { - var targetNode = umbraco.TypedContent(model.Source.Id); + var targetNode = umbraco.Content(model.Source.Id); if (targetNode != null) { diff --git a/src/Umbraco.Web/IPublishedContentQuery.cs b/src/Umbraco.Web/IPublishedContentQuery.cs new file mode 100644 index 0000000000..2d787a316f --- /dev/null +++ b/src/Umbraco.Web/IPublishedContentQuery.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Xml.XPath; +using Umbraco.Core.Models.PublishedContent; +using Umbraco.Core.Xml; + +namespace Umbraco.Web +{ + /// + /// Query methods used for accessing strongly typed content in templates + /// + public interface IPublishedContentQuery + { + IPublishedContent Content(int id); + IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars); + IEnumerable Content(IEnumerable ids); + IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars); + IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars); + IEnumerable ContentAtRoot(); + + IPublishedContent Media(int id); + IEnumerable Media(IEnumerable ids); + IEnumerable MediaAtRoot(); + + /// + /// Searches content + /// + /// + /// + /// + /// + IEnumerable Search(string term, bool useWildCards = true, string searchProvider = null); + + /// + /// Searhes content + /// + /// + /// + /// + IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null); + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/ITypedPublishedContentQuery.cs b/src/Umbraco.Web/ITypedPublishedContentQuery.cs deleted file mode 100644 index a5452e8d30..0000000000 --- a/src/Umbraco.Web/ITypedPublishedContentQuery.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Xml.XPath; -using Umbraco.Core.Models; -using Umbraco.Core.Models.PublishedContent; -using Umbraco.Core.Xml; - -namespace Umbraco.Web -{ - /// - /// Query methods used for accessing strongly typed content in templates - /// - public interface ITypedPublishedContentQuery - { - IPublishedContent TypedContent(int id); - IPublishedContent TypedContentSingleAtXPath(string xpath, params XPathVariable[] vars); - IEnumerable TypedContent(IEnumerable ids); - IEnumerable TypedContentAtXPath(string xpath, params XPathVariable[] vars); - IEnumerable TypedContentAtXPath(XPathExpression xpath, params XPathVariable[] vars); - IEnumerable TypedContentAtRoot(); - - IPublishedContent TypedMedia(int id); - IEnumerable TypedMedia(IEnumerable ids); - IEnumerable TypedMediaAtRoot(); - - /// - /// Searches content - /// - /// - /// - /// - /// - IEnumerable TypedSearch(string term, bool useWildCards = true, string searchProvider = null); - - /// - /// Searhes content - /// - /// - /// - /// - IEnumerable TypedSearch(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null); - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs b/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs index 4f88b1c7c3..6406c7ea8a 100644 --- a/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs +++ b/src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs @@ -118,7 +118,7 @@ namespace Umbraco.Web.Mvc { if (_contentId.HasValue) { - var content = Umbraco.TypedContent(_contentId); + var content = Umbraco.Content(_contentId); if (content == null) { throw new InvalidOperationException("Could not resolve content with id " + _contentId); diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index cb3ca5241d..7f12a29f24 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Xml.XPath; using Umbraco.Core; using Umbraco.Core.Models.PublishedContent; -using Umbraco.Core.Plugins; using Umbraco.Core.Xml; using Umbraco.Web.PublishedCache; @@ -13,9 +12,9 @@ namespace Umbraco.Web /// /// A class used to query for published content, media items /// - public class PublishedContentQuery : ITypedPublishedContentQuery + public class PublishedContentQuery : IPublishedContentQuery { - private readonly ITypedPublishedContentQuery _typedContentQuery; + private readonly IPublishedContentQuery _query; private readonly IPublishedContentCache _contentCache; private readonly IPublishedMediaCache _mediaCache; @@ -35,80 +34,80 @@ namespace Umbraco.Web /// /// Constructor used to wrap the ITypedPublishedContentQuery object passed in /// - /// - public PublishedContentQuery(ITypedPublishedContentQuery typedContentQuery) + /// + public PublishedContentQuery(IPublishedContentQuery query) { - if (typedContentQuery == null) throw new ArgumentNullException(nameof(typedContentQuery)); - _typedContentQuery = typedContentQuery; + if (query == null) throw new ArgumentNullException(nameof(query)); + _query = query; } #region Content - public IPublishedContent TypedContent(int id) + public IPublishedContent Content(int id) { - return _typedContentQuery == null - ? TypedDocumentById(id, _contentCache) - : _typedContentQuery.TypedContent(id); + return _query == null + ? ItemById(id, _contentCache) + : _query.Content(id); } - public IPublishedContent TypedContentSingleAtXPath(string xpath, params XPathVariable[] vars) + public IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars) { - return _typedContentQuery == null - ? TypedDocumentByXPath(xpath, vars, _contentCache) - : _typedContentQuery.TypedContentSingleAtXPath(xpath, vars); + return _query == null + ? ItemByXPath(xpath, vars, _contentCache) + : _query.ContentSingleAtXPath(xpath, vars); } - public IEnumerable TypedContent(IEnumerable ids) + public IEnumerable Content(IEnumerable ids) { - return _typedContentQuery == null - ? TypedDocumentsByIds(_contentCache, ids) - : _typedContentQuery.TypedContent(ids); + return _query == null + ? ItemsByIds(_contentCache, ids) + : _query.Content(ids); } - public IEnumerable TypedContentAtXPath(string xpath, params XPathVariable[] vars) + public IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars) { - return _typedContentQuery == null - ? TypedDocumentsByXPath(xpath, vars, _contentCache) - : _typedContentQuery.TypedContentAtXPath(xpath, vars); + return _query == null + ? ItemsByXPath(xpath, vars, _contentCache) + : _query.ContentAtXPath(xpath, vars); } - public IEnumerable TypedContentAtXPath(XPathExpression xpath, params XPathVariable[] vars) + public IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars) { - return _typedContentQuery == null - ? TypedDocumentsByXPath(xpath, vars, _contentCache) - : _typedContentQuery.TypedContentAtXPath(xpath, vars); + return _query == null + ? ItemsByXPath(xpath, vars, _contentCache) + : _query.ContentAtXPath(xpath, vars); } - public IEnumerable TypedContentAtRoot() + public IEnumerable ContentAtRoot() { - return _typedContentQuery == null - ? TypedDocumentsAtRoot(_contentCache) - : _typedContentQuery.TypedContentAtRoot(); + return _query == null + ? ItemsAtRoot(_contentCache) + : _query.ContentAtRoot(); } #endregion #region Media - public IPublishedContent TypedMedia(int id) + public IPublishedContent Media(int id) { - return _typedContentQuery == null - ? TypedDocumentById(id, _mediaCache) - : _typedContentQuery.TypedMedia(id); + return _query == null + ? ItemById(id, _mediaCache) + : _query.Media(id); } - public IEnumerable TypedMedia(IEnumerable ids) + public IEnumerable Media(IEnumerable ids) { - return _typedContentQuery == null - ? TypedDocumentsByIds(_mediaCache, ids) - : _typedContentQuery.TypedMedia(ids); + return _query == null + ? ItemsByIds(_mediaCache, ids) + : _query.Media(ids); } - public IEnumerable TypedMediaAtRoot() + public IEnumerable MediaAtRoot() { - return _typedContentQuery == null - ? TypedDocumentsAtRoot(_mediaCache) - : _typedContentQuery.TypedMediaAtRoot(); + return _query == null + ? ItemsAtRoot(_mediaCache) + : _query.MediaAtRoot(); } @@ -116,43 +115,43 @@ namespace Umbraco.Web #region Used by Content/Media - private IPublishedContent TypedDocumentById(int id, IPublishedCache cache) + private static IPublishedContent ItemById(int id, IPublishedCache cache) { var doc = cache.GetById(id); return doc; } - private IPublishedContent TypedDocumentByXPath(string xpath, XPathVariable[] vars, IPublishedContentCache cache) + private static IPublishedContent ItemByXPath(string xpath, XPathVariable[] vars, IPublishedCache cache) { var doc = cache.GetSingleByXPath(xpath, vars); return doc; } //NOTE: Not used? - //private IPublishedContent TypedDocumentByXPath(XPathExpression xpath, XPathVariable[] vars, IPublishedContentCache cache) + //private IPublishedContent ItemByXPath(XPathExpression xpath, XPathVariable[] vars, IPublishedCache cache) //{ // var doc = cache.GetSingleByXPath(xpath, vars); // return doc; //} - private IEnumerable TypedDocumentsByIds(IPublishedCache cache, IEnumerable ids) + private static IEnumerable ItemsByIds(IPublishedCache cache, IEnumerable ids) { - return ids.Select(eachId => TypedDocumentById(eachId, cache)).WhereNotNull(); + return ids.Select(eachId => ItemById(eachId, cache)).WhereNotNull(); } - private IEnumerable TypedDocumentsByXPath(string xpath, XPathVariable[] vars, IPublishedContentCache cache) + private static IEnumerable ItemsByXPath(string xpath, XPathVariable[] vars, IPublishedCache cache) { var doc = cache.GetByXPath(xpath, vars); return doc; } - private IEnumerable TypedDocumentsByXPath(XPathExpression xpath, XPathVariable[] vars, IPublishedContentCache cache) + private static IEnumerable ItemsByXPath(XPathExpression xpath, XPathVariable[] vars, IPublishedCache cache) { var doc = cache.GetByXPath(xpath, vars); return doc; } - private IEnumerable TypedDocumentsAtRoot(IPublishedCache cache) + private static IEnumerable ItemsAtRoot(IPublishedCache cache) { return cache.GetAtRoot(); } @@ -168,9 +167,9 @@ namespace Umbraco.Web /// /// /// - public IEnumerable TypedSearch(string term, bool useWildCards = true, string searchProvider = null) + public IEnumerable Search(string term, bool useWildCards = true, string searchProvider = null) { - if (_typedContentQuery != null) return _typedContentQuery.TypedSearch(term, useWildCards, searchProvider); + if (_query != null) return _query.Search(term, useWildCards, searchProvider); var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider; if (string.IsNullOrEmpty(searchProvider) == false) @@ -186,9 +185,9 @@ namespace Umbraco.Web /// /// /// - public IEnumerable TypedSearch(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) + public IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) { - if (_typedContentQuery != null) return _typedContentQuery.TypedSearch(criteria, searchProvider); + if (_query != null) return _query.Search(criteria, searchProvider); var s = Examine.ExamineManager.Instance.DefaultSearchProvider; if (searchProvider != null) diff --git a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs index dd8ba0f008..0119484d37 100644 --- a/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs +++ b/src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.Routing IContentErrorPage[] error404Collection, string requestServerName, IEntityService entityService, - ITypedPublishedContentQuery publishedContentQuery, + IPublishedContentQuery publishedContentQuery, IDomainService domainService) { throw new NotImplementedException(); @@ -39,7 +39,7 @@ namespace Umbraco.Web.Routing internal static int? GetCurrentNotFoundPageId( IContentErrorPage[] error404Collection, IEntityService entityService, - ITypedPublishedContentQuery publishedContentQuery, + IPublishedContentQuery publishedContentQuery, CultureInfo errorCulture) { if (error404Collection.Length > 1) @@ -66,7 +66,7 @@ namespace Umbraco.Web.Routing /// /// /// - internal static int? GetContentIdFromErrorPageConfig(IContentErrorPage errorPage, IEntityService entityService, ITypedPublishedContentQuery publishedContentQuery) + internal static int? GetContentIdFromErrorPageConfig(IContentErrorPage errorPage, IEntityService entityService, IPublishedContentQuery publishedContentQuery) { if (errorPage.HasContentId) return errorPage.ContentId; @@ -97,10 +97,10 @@ namespace Umbraco.Web.Routing var ent = entityService.Get(nodeid); return ent.Path.Split(',').Reverse(); }, - publishedContentExists: i => publishedContentQuery.TypedContent(i) != null); + publishedContentExists: i => publishedContentQuery.Content(i) != null); //now we'll try to execute the expression - var nodeResult = publishedContentQuery.TypedContentSingleAtXPath(xpathResult); + var nodeResult = publishedContentQuery.ContentSingleAtXPath(xpathResult); if (nodeResult != null) return nodeResult.Id; } diff --git a/src/Umbraco.Web/TagQuery.cs b/src/Umbraco.Web/TagQuery.cs index a26aea71ec..02e862003c 100644 --- a/src/Umbraco.Web/TagQuery.cs +++ b/src/Umbraco.Web/TagQuery.cs @@ -20,7 +20,7 @@ namespace Umbraco.Web private readonly ITagQuery _wrappedQuery; private readonly ITagService _tagService; - private readonly ITypedPublishedContentQuery _typedContentQuery; + private readonly IPublishedContentQuery _contentQuery; [Obsolete("Use the alternate constructor specifying the contentQuery instead")] public TagQuery(ITagService tagService) @@ -34,7 +34,7 @@ namespace Umbraco.Web if (tagService == null) throw new ArgumentNullException("tagService"); if (contentQuery == null) throw new ArgumentNullException("contentQuery"); _tagService = tagService; - _typedContentQuery = contentQuery; + _contentQuery = contentQuery; } /// @@ -51,13 +51,13 @@ namespace Umbraco.Web /// Constructor /// /// - /// - public TagQuery(ITagService tagService, ITypedPublishedContentQuery typedContentQuery) + /// + public TagQuery(ITagService tagService, IPublishedContentQuery contentQuery) { if (tagService == null) throw new ArgumentNullException("tagService"); - if (typedContentQuery == null) throw new ArgumentNullException("typedContentQuery"); + if (contentQuery == null) throw new ArgumentNullException("contentQuery"); _tagService = tagService; - _typedContentQuery = typedContentQuery; + _contentQuery = contentQuery; } /// @@ -73,7 +73,7 @@ namespace Umbraco.Web var ids = _tagService.GetTaggedContentByTag(tag, tagGroup) .Select(x => x.EntityId); - return _typedContentQuery.TypedContent(ids) + return _contentQuery.Content(ids) .Where(x => x != null); } @@ -89,7 +89,7 @@ namespace Umbraco.Web var ids = _tagService.GetTaggedContentByTagGroup(tagGroup) .Select(x => x.EntityId); - return _typedContentQuery.TypedContent(ids) + return _contentQuery.Content(ids) .Where(x => x != null); } @@ -106,7 +106,7 @@ namespace Umbraco.Web var ids = _tagService.GetTaggedMediaByTag(tag, tagGroup) .Select(x => x.EntityId); - return _typedContentQuery.TypedMedia(ids) + return _contentQuery.Media(ids) .Where(x => x != null); } @@ -122,7 +122,7 @@ namespace Umbraco.Web var ids = _tagService.GetTaggedMediaByTagGroup(tagGroup) .Select(x => x.EntityId); - return _typedContentQuery.TypedMedia(ids) + return _contentQuery.Media(ids) .Where(x => x != null); } diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index cdd62eb4e8..6010511526 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -169,7 +169,7 @@ - + diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 280cc86ccc..ee8c7eb28c 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -2,7 +2,6 @@ using System.ComponentModel; using System.Web; using System.Web.Security; -using System.Xml.Linq; using System.Xml.XPath; using Umbraco.Core; using Umbraco.Core.Dictionary; @@ -26,7 +25,7 @@ namespace Umbraco.Web { private readonly UmbracoContext _umbracoContext; private readonly IPublishedContent _currentPage; - private readonly ITypedPublishedContentQuery _typedQuery; + private readonly IPublishedContentQuery _iQuery; private readonly HtmlStringUtilities _stringUtilities = new HtmlStringUtilities(); private IUmbracoComponentRenderer _componentRenderer; @@ -42,14 +41,14 @@ namespace Umbraco.Web /// public ITagQuery TagQuery => _tag ?? (_tag = new TagQuery(UmbracoContext.Application.Services.TagService, - _typedQuery ?? ContentQuery)); + _iQuery ?? ContentQuery)); /// /// Lazy instantiates the query context if not specified in the constructor /// public PublishedContentQuery ContentQuery => _query ?? - (_query = _typedQuery != null - ? new PublishedContentQuery(_typedQuery) + (_query = _iQuery != null + ? new PublishedContentQuery(_iQuery) : new PublishedContentQuery(UmbracoContext.ContentCache, UmbracoContext.MediaCache)); /// @@ -103,8 +102,7 @@ namespace Umbraco.Web /// /// /// - /// - /// + /// /// /// /// @@ -115,7 +113,7 @@ namespace Umbraco.Web /// This constructor can be used to create a testable UmbracoHelper /// public UmbracoHelper(UmbracoContext umbracoContext, IPublishedContent content, - ITypedPublishedContentQuery typedQuery, + IPublishedContentQuery query, ITagQuery tagQuery, IDataTypeService dataTypeService, UrlProvider urlProvider, @@ -125,7 +123,7 @@ namespace Umbraco.Web { if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext)); if (content == null) throw new ArgumentNullException(nameof(content)); - if (typedQuery == null) throw new ArgumentNullException(nameof(typedQuery)); + if (query == null) throw new ArgumentNullException(nameof(query)); if (tagQuery == null) throw new ArgumentNullException(nameof(tagQuery)); if (dataTypeService == null) throw new ArgumentNullException(nameof(dataTypeService)); if (urlProvider == null) throw new ArgumentNullException(nameof(urlProvider)); @@ -141,7 +139,7 @@ namespace Umbraco.Web _componentRenderer = componentRenderer; _membershipHelper = membershipHelper; _currentPage = content; - _typedQuery = typedQuery; + _iQuery = query; } /// @@ -466,18 +464,18 @@ namespace Umbraco.Web #region Members - public IPublishedContent TypedMember(object id) + public IPublishedContent Member(object id) { var asInt = id.TryConvertTo(); return asInt ? MembershipHelper.GetById(asInt.Result) : MembershipHelper.GetByProviderKey(id); } - public IPublishedContent TypedMember(int id) + public IPublishedContent Member(int id) { return MembershipHelper.GetById(id); } - public IPublishedContent TypedMember(string id) + public IPublishedContent Member(string id) { var asInt = id.TryConvertTo(); return asInt ? MembershipHelper.GetById(asInt.Result) : MembershipHelper.GetByProviderKey(id); @@ -487,31 +485,31 @@ namespace Umbraco.Web #region Content - public IPublishedContent TypedContent(object id) + public IPublishedContent Content(object id) { int intId; - return ConvertIdObjectToInt(id, out intId) ? ContentQuery.TypedContent(intId) : null; + return ConvertIdObjectToInt(id, out intId) ? ContentQuery.Content(intId) : null; } - public IPublishedContent TypedContent(int id) + public IPublishedContent Content(int id) { - return ContentQuery.TypedContent(id); + return ContentQuery.Content(id); } - public IPublishedContent TypedContent(string id) + public IPublishedContent Content(string id) { int intId; - return ConvertIdObjectToInt(id, out intId) ? ContentQuery.TypedContent(intId) : null; + return ConvertIdObjectToInt(id, out intId) ? ContentQuery.Content(intId) : null; } - public IPublishedContent TypedContentSingleAtXPath(string xpath, params XPathVariable[] vars) + public IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars) { - return ContentQuery.TypedContentSingleAtXPath(xpath, vars); + return ContentQuery.ContentSingleAtXPath(xpath, vars); } - public IEnumerable TypedContent(params object[] ids) + public IEnumerable Content(params object[] ids) { - return ContentQuery.TypedContent(ConvertIdsObjectToInts(ids)); + return ContentQuery.Content(ConvertIdsObjectToInts(ids)); } /// @@ -520,9 +518,9 @@ namespace Umbraco.Web /// The content identifiers. /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. - public IEnumerable TypedContent(params int[] ids) + public IEnumerable Content(params int[] ids) { - return ContentQuery.TypedContent(ids); + return ContentQuery.Content(ids); } /// @@ -531,9 +529,9 @@ namespace Umbraco.Web /// The content identifiers. /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. - public IEnumerable TypedContent(params string[] ids) + public IEnumerable Content(params string[] ids) { - return ContentQuery.TypedContent(ConvertIdsObjectToInts(ids)); + return ContentQuery.Content(ConvertIdsObjectToInts(ids)); } /// @@ -542,9 +540,9 @@ namespace Umbraco.Web /// The content identifiers. /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. - public IEnumerable TypedContent(IEnumerable ids) + public IEnumerable Content(IEnumerable ids) { - return ContentQuery.TypedContent(ConvertIdsObjectToInts(ids)); + return ContentQuery.Content(ConvertIdsObjectToInts(ids)); } /// @@ -553,9 +551,9 @@ namespace Umbraco.Web /// The content identifiers. /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. - public IEnumerable TypedContent(IEnumerable ids) + public IEnumerable Content(IEnumerable ids) { - return ContentQuery.TypedContent(ConvertIdsObjectToInts(ids)); + return ContentQuery.Content(ConvertIdsObjectToInts(ids)); } /// @@ -564,24 +562,24 @@ namespace Umbraco.Web /// The content identifiers. /// The existing contents corresponding to the identifiers. /// If an identifier does not match an existing content, it will be missing in the returned value. - public IEnumerable TypedContent(IEnumerable ids) + public IEnumerable Content(IEnumerable ids) { - return ContentQuery.TypedContent(ids); + return ContentQuery.Content(ids); } - public IEnumerable TypedContentAtXPath(string xpath, params XPathVariable[] vars) + public IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars) { - return ContentQuery.TypedContentAtXPath(xpath, vars); + return ContentQuery.ContentAtXPath(xpath, vars); } - public IEnumerable TypedContentAtXPath(XPathExpression xpath, params XPathVariable[] vars) + public IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars) { - return ContentQuery.TypedContentAtXPath(xpath, vars); + return ContentQuery.ContentAtXPath(xpath, vars); } - public IEnumerable TypedContentAtRoot() + public IEnumerable ContentAtRoot() { - return ContentQuery.TypedContentAtRoot(); + return ContentQuery.ContentAtRoot(); } private bool ConvertIdObjectToInt(object id, out int intId) @@ -629,21 +627,21 @@ namespace Umbraco.Web /// this result in to this method. /// This method will throw an exception if the value is not of type int or string. /// - public IPublishedContent TypedMedia(object id) + public IPublishedContent Media(object id) { int intId; - return ConvertIdObjectToInt(id, out intId) ? ContentQuery.TypedMedia(intId) : null; + return ConvertIdObjectToInt(id, out intId) ? ContentQuery.Media(intId) : null; } - public IPublishedContent TypedMedia(int id) + public IPublishedContent Media(int id) { - return ContentQuery.TypedMedia(id); + return ContentQuery.Media(id); } - public IPublishedContent TypedMedia(string id) + public IPublishedContent Media(string id) { int intId; - return ConvertIdObjectToInt(id, out intId) ? ContentQuery.TypedMedia(intId) : null; + return ConvertIdObjectToInt(id, out intId) ? ContentQuery.Media(intId) : null; } /// @@ -652,9 +650,9 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(params object[] ids) + public IEnumerable Media(params object[] ids) { - return ContentQuery.TypedMedia(ConvertIdsObjectToInts(ids)); + return ContentQuery.Media(ConvertIdsObjectToInts(ids)); } /// @@ -663,9 +661,9 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(params int[] ids) + public IEnumerable Media(params int[] ids) { - return ContentQuery.TypedMedia(ids); + return ContentQuery.Media(ids); } /// @@ -674,9 +672,9 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(params string[] ids) + public IEnumerable Media(params string[] ids) { - return ContentQuery.TypedMedia(ConvertIdsObjectToInts(ids)); + return ContentQuery.Media(ConvertIdsObjectToInts(ids)); } /// @@ -685,9 +683,9 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(IEnumerable ids) + public IEnumerable Media(IEnumerable ids) { - return ContentQuery.TypedMedia(ConvertIdsObjectToInts(ids)); + return ContentQuery.Media(ConvertIdsObjectToInts(ids)); } /// @@ -696,9 +694,9 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(IEnumerable ids) + public IEnumerable Media(IEnumerable ids) { - return ContentQuery.TypedMedia(ids); + return ContentQuery.Media(ids); } /// @@ -707,14 +705,14 @@ namespace Umbraco.Web /// The media identifiers. /// The existing medias corresponding to the identifiers. /// If an identifier does not match an existing media, it will be missing in the returned value. - public IEnumerable TypedMedia(IEnumerable ids) + public IEnumerable Media(IEnumerable ids) { - return ContentQuery.TypedMedia(ConvertIdsObjectToInts(ids)); + return ContentQuery.Media(ConvertIdsObjectToInts(ids)); } - public IEnumerable TypedMediaAtRoot() + public IEnumerable MediaAtRoot() { - return ContentQuery.TypedMediaAtRoot(); + return ContentQuery.MediaAtRoot(); } #endregion @@ -728,9 +726,9 @@ namespace Umbraco.Web /// /// /// - public IEnumerable TypedSearch(string term, bool useWildCards = true, string searchProvider = null) + public IEnumerable Search(string term, bool useWildCards = true, string searchProvider = null) { - return ContentQuery.TypedSearch(term, useWildCards, searchProvider); + return ContentQuery.Search(term, useWildCards, searchProvider); } /// @@ -739,9 +737,9 @@ namespace Umbraco.Web /// /// /// - public IEnumerable TypedSearch(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) + public IEnumerable Search(Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null) { - return ContentQuery.TypedSearch(criteria, searchProvider); + return ContentQuery.Search(criteria, searchProvider); } #endregion