public JsonCollection Build()
        {
            var items = new List <Item>(Collection.items);

            foreach (var data_source in DataSources)
            {
                var item = ItemBuilder(TemplateType, data_source);

                var links = new List <Link>();

                foreach (var link_builder in LinksBuilder)
                {
                    links.Add(link_builder(data_source));
                }

                var temp_data = new List <Data>(item.data);

                foreach (var custom_data_builder in CustomsDataBuilder)
                {
                    temp_data.Add(custom_data_builder(data_source));
                }

                item.self  = SelfLinkBuilder(data_source);
                item.links = links;
                item.data  = temp_data;

                items.Add(item);
            }

            Collection.items = items;

            return(JsonCollectionConfiguration.Build());
        }
 public ITemplateDataSourceConfiguration AddTemplateFor <TTemplate>()
 {
     Build();
     return(JsonCollectionConfiguration.AddTemplateFor <TTemplate>());
 }
 public IItemDataSourceConfiguration AddItemsFor <ItemModel>()
 {
     Build();
     return(JsonCollectionConfiguration.AddItemsFor <ItemModel>());
 }
 public void SetUrl(string url)
 {
     JsonCollectionConfiguration.SetUrl(url);
 }
 public IJsonCollectionConfiguration AddLink(Link link)
 {
     return(JsonCollectionConfiguration.AddLink(link));
 }
 public IQueryConfiguration AddQueryFor(object filter)
 {
     Build();
     return(JsonCollectionConfiguration.AddQueryFor(filter));
 }