* Update gitignore * Move csproj * Update project references * Update solutions * Update build scripts * Tests used to share editorconfig with projects in src * Fix broken tests. * Stop copying around .editorconfig merged root one with linting * csharp_style_expression_bodied -> suggestion * Move StyleCop rulesets to matching directories and update shared build properties * Remove legacy build files, update NuGet.cofig and solution files * Restore myget source * Clean up .gitignore * Update .gitignore * Move new test classes to tests after merge * Gitignore + nuget config * Move new test Co-authored-by: Ronald Barendse <ronald@barend.se>
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using Umbraco.Cms.Core.Models;
|
|
using Umbraco.Cms.Core.Models.PublishedContent;
|
|
using Umbraco.Cms.Core.PublishedCache;
|
|
using Umbraco.Extensions;
|
|
using Umbraco.Web.Composing;
|
|
|
|
namespace Umbraco.Tests.LegacyXmlPublishedCache
|
|
{
|
|
class PublishedMemberCache : IPublishedMemberCache
|
|
{
|
|
private readonly PublishedContentTypeCache _contentTypeCache;
|
|
private readonly IVariationContextAccessor _variationContextAccessor;
|
|
|
|
public PublishedMemberCache(PublishedContentTypeCache contentTypeCache, IVariationContextAccessor variationContextAccessor)
|
|
{
|
|
_contentTypeCache = contentTypeCache;
|
|
_variationContextAccessor = variationContextAccessor;
|
|
}
|
|
|
|
public IPublishedContent Get(IMember member)
|
|
{
|
|
var type = _contentTypeCache.Get(PublishedItemType.Member, member.ContentTypeId);
|
|
return new PublishedMember(member, type, _variationContextAccessor)
|
|
.CreateModel(Current.PublishedModelFactory);
|
|
}
|
|
|
|
#region Content types
|
|
|
|
public IPublishedContentType GetContentType(int id) => _contentTypeCache.Get(PublishedItemType.Member, id);
|
|
|
|
public IPublishedContentType GetContentType(string alias) => _contentTypeCache.Get(PublishedItemType.Member, alias);
|
|
|
|
#endregion
|
|
}
|
|
}
|