public Node Arr()
        {
            var n = new Arr();

            Expect(TokenCategory.OPENEDBRACKET);
            n.Add(ExprList());
            Expect(TokenCategory.CLOSEDBRACKET);
            return(n);
        }
Beispiel #2
0
        internal override RESTarView <IEnumerable <object> > Populate(Request request, IEnumerable <object> data)
        {
            base.Populate(request, data);
            CanInsert = Resource.AvailableMethods.Contains(RESTarMethods.POST);
            if (data?.Any() != true)
            {
                return(this);
            }
            var template     = request.Resource.MakeViewModelTemplate();
            var jsonTemplate = $"[{template.SerializeVmJsonTemplate()}]";

            Entities = new Arr <Json> {
                Template = Starcounter.Templates.Template.CreateFromJson(jsonTemplate)
            };
            data.ForEach(e => Entities.Add().PopulateFromJson(e.SerializeStaticResourceToViewModel()));
            return(this);
        }
 public TgCallMiddlewareChain Add(ITgCallMiddleware middleware) => With(
     middleware: Middleware.Add(middleware)
     );