Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #5
0
        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);
Example #11
0
 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();
 }
Example #14
0
 public StaticDataController(IDomainRoot domainRoot, IOptions <Configuration> configuration)
     : base(domainRoot)
 {
     _configuration = configuration.Value;
 }
Example #15
0
 public ListsController(IDomainRoot domainRoot) : base(domainRoot, x => x.Lists)
 {
 }
 protected DomainRootController(IDomainRoot domainRoot)
 {
     DomainRoot = domainRoot;
 }
 public ActionResult XMLSitemap(IDomainRoot model)
 => CurrentTemplate(model);
Example #18
0
 public EntityModelResolver(IDomainRoot domainRoot)
 {
     _domainRoot = domainRoot;
 }