/// <summary> /// Konstruktor klasy LayoutService /// </summary> public LayoutService(IDBService dbService, IUmbracoHelperService umbHelperService, IAccountService accountService) { _umbracoHelper = new UmbracoHelper(UmbracoContext.Current); _dbService = dbService; _umbHelperService = umbHelperService; _accountService = accountService; }
public static void Configure(IUmbracoMapper umbracoMapper, IUmbracoHelperService umbracoHelperService) { UmbracoHelperService = umbracoHelperService; umbracoMapper.AddCustomMapping(typeof(BaseWebPage).FullName, MapBaseWebPage); umbracoMapper.AddCustomMapping(typeof(MediaFile).FullName, MapMediaFile); umbracoMapper.AddCustomMapping(typeof(IEnumerable<MediaFile>).FullName, MapMediaFiles); }
protected void OverrideRegisteredIUmbracoHelperService(IUmbracoHelperService umbracoHelperServiceOverride) { Bootstrapper.Container.Register( Component.For<IUmbracoHelperService>() .Instance(umbracoHelperServiceOverride) .OverridesExistingRegistration()); }
protected INodeService SetupRepositoryNodeService(IPublishedContentRepository repository, IUmbracoHelperService umbracoHelperService) { var publishedContentExtensionService = new Mock<IPublishedContentExtensionService>(); IEnumerable<IPublishedContent> children = null; publishedContentExtensionService.Setup(x => x.Children(It.IsAny<IPublishedContent>())) .Callback((IPublishedContent publishedContent) => children = repository.Children(publishedContent)) .Returns(() => children.Select(x => x)); IEnumerable<IPublishedContent> ancestors = null; publishedContentExtensionService.Setup(x => x.Ancestors(It.IsAny<IPublishedContent>())) .Callback((IPublishedContent publishedContent) => ancestors = repository.Ancestors(publishedContent)) .Returns(() => ancestors.Select(x => x)); return new NodeService(new UmbracoMapper(), umbracoHelperService, publishedContentExtensionService.Object); }