public TM UniqueResultBox()
 {
     _transformation.Entries = new List <TE> {
         UniqueResult()
     };
     return(_transformation.ToBox().FirstOrDefault());
 }
예제 #2
0
        public string getRelationsByType(string path)
        {
            var taxNode = _tree.FindOne(path);

            if (taxNode == null)
            {
                return(null);
            }

            relationTransformer.Entries = _relationRepo.GetRelationsByType(taxNode);
            return(JsonConvert.SerializeObject(relationTransformer.ToBox()));
        }
예제 #3
0
        public string getListEntries(string typename, int id)
        {
            var settings = _settingsService.GetFor(new ClassifiableElementProxy(typename, id));

            _settingsTransformer.Entries = new[] { settings };
            var box = _settingsTransformer.ToBox().First();

            var viewmodel = box.Entries.Select(
                d => new
            {
                Name  = d.Name,
                Value = d.GetValue(),
                //d.IsContract?ToJsObject(d.GetValue()):d.GetValue().ToString(),
                Type = d.ContractType
            }).ToList();

            var obj = new
            {
                total   = viewmodel.Count(),
                page    = 1,
                records = viewmodel.Count(),
                rows    = viewmodel
            };

            return(JsonConvert.SerializeObject(obj));
        }
        private IList <MetricsEntryBoxMap> GetMetricsEntries(string typename, int id, string metricsName)
        {
            var classifiable = new ClassifiableElementProxy(typename, id);
            var metrics      = _metricsService.GetFor(classifiable);
            var entries      = metrics.FirstOrDefault(m => m.Name == metricsName);

            if (entries == null)
            {
                return(null);
            }

            entryTransformation.Entries = entries.Entries;
            return(entryTransformation.ToBox());
        }