コード例 #1
0
        public ObjectResult Children(ServiceKeyWeb postData)
        {
            return(WebFunction.Execute <ServiceKeyWeb, List <ServiceChildWeb> >(this, postData, (sv) =>
            {
                var key = new ServiceKey(sv);
                var children = ServiceHierarchy.Get(key);

                return new WebResult <List <ServiceChildWeb> >(children.Select(c => c.ToWeb()).ToList());
            }));
        }
コード例 #2
0
        public void Get()
        {
            Startup.LoadSettings();
            // test assumes service 212 has child of 213 named "test"

            var key = new ServiceKey();

            key.Id            = 212;
            key.EffectiveDate = DateTime.Now;
            key.AddValue("ValueTest", "8", PCAT.Common.Models.Attribute.AttributeType.Integer);

            var sh = ServiceHierarchy.Get(key);

            Assert.IsTrue(sh.Count > 0);
            Assert.AreEqual(sh[0].Name, "test");
        }