private void initSampleData(IDomainRoot root) { root.Companies.Add(getSampleCompany("Apple")); root.Companies.Add(getSampleCompany("Google")); root.Companies.Add(getSampleCompany("Microsoft")); foreach (var company in root.Companies) company.Employees.Add(getSampleEmployee(company.Name)); }
private void initSampleData(IDomainRoot root) { root.Companies.Add(getSampleCompany("Apple")); root.Companies.Add(getSampleCompany("Google")); root.Companies.Add(getSampleCompany("Microsoft")); foreach (var company in root.Companies) { company.Employees.Add(getSampleEmployee(company.Name)); } }
protected BusinessEventDomainRootBase(string entityName, int version, IDomainRoot domainRoot, string eventName, object entityObject = null, object additionalMetadata = null) { EntityKey = domainRoot.Key; CorrelationId = domainRoot.CorrelationId; EventName = eventName; EntityObject = entityObject; AdditionalMetadata = additionalMetadata; EntityName = entityName; Version = version; EventDateTime = DateTime.Now; }
private static void AssertDomain(IDomainRoot domainRoot) { Assert.That(domainRoot.Maps.Landranger.Count, Is.EqualTo(204)); Assert.That(domainRoot.Maps.LandrangerActive.Count, Is.EqualTo(204)); Assert.That(domainRoot.Maps.Explorer.Count, Is.EqualTo(403)); Assert.That(domainRoot.Maps.ExplorerActive.Count, Is.EqualTo(403)); Assert.That(domainRoot.Maps.Discoverer.Count, Is.EqualTo(18)); Assert.That(domainRoot.Maps.Discovery.Count, Is.EqualTo(73)); Assert.That(domainRoot.Lists.Count, Is.EqualTo(24)); Assert.That(domainRoot.Sections.Count, Is.EqualTo(71)); Assert.That(domainRoot.Mountains.Count, Is.EqualTo(12135)); }
public MountainModel(Mountain mountain, IDomainRoot domainRoot) : base(mountain) { Height = mountain.Height.ToString(); Latitude = mountain.Location.Latitude; Longitude = mountain.Location.Longitude; SixFigureGridRef = mountain.Location.GridRef.SixFigure; TenFigureGridRef = mountain.Location.GridRef.TenFigure; Prominence = mountain.Prominence.ToString(); Feature = mountain.Feature; Observations = mountain.Observations; var resolver = new EntityModelResolver(domainRoot); Lists = resolver.Lists(mountain.ListIds); Maps = resolver.Maps(mountain.MapIds); Section = resolver.Section(mountain.SectionId); Country = resolver.Country(mountain.CountryId); }
public SectionsController(IDomainRoot domainRoot) : base(domainRoot, x => x.Sections) { }
public MapsController(IDomainRoot domainRoot) : base(domainRoot, x => x.Maps) { }
protected EntitiesController(IDomainRoot domainRoot, Func <IDomainRoot, IEnumerable <T> > entitiesFunc) : base(domainRoot) { _entitiesFunc = entitiesFunc; }
public ActionResult XMLSitemap(IDomainRoot model) => CurrentTemplate(new XMLSitemapViewModel(model));
/// <summary> /// Returns Search Engines Sitemap i.e. Sitemap XML items from the provided <paramref name="domain"/> node. /// </summary> /// <typeparam name="T">Type of sitemap pages to return.</typeparam> /// <param name="domain">Domain root node.</param> /// <param name="maxLevel">The max level of pages to include in sitemap.</param> /// <returns>Sitemap XML items.</returns> public static IEnumerable <T> GetSitemapXMLItems <T>(this IDomainRoot domain, int maxLevel = Constants.SitemapXMLPageMaxLevel) where T : class, IPage => domain.DescendantsOrSelf <T>(d => d.Level <= maxLevel && !d.HideFromSearchEngines);
public SearchController(IDomainRoot domainRoot) : base(domainRoot) { }
public MountainsController(IDomainRoot domainRoot) : base(domainRoot) { }
public XMLSitemapViewModel(IDomainRoot node) { Items = node.GetSitemapXMLItems <ISeo>().Select(p => p.ToViewModel()).ToList(); }
public StaticDataController(IDomainRoot domainRoot, IOptions <Configuration> configuration) : base(domainRoot) { _configuration = configuration.Value; }
public ListsController(IDomainRoot domainRoot) : base(domainRoot, x => x.Lists) { }
protected DomainRootController(IDomainRoot domainRoot) { DomainRoot = domainRoot; }
public ActionResult XMLSitemap(IDomainRoot model) => CurrentTemplate(model);
public EntityModelResolver(IDomainRoot domainRoot) { _domainRoot = domainRoot; }