public void AddNestedRow(int outerId, int innerId, string name) { _nestedTabularValue.Put(r => { r.Simple("ID", innerId); r.Table("Value", t => t.Put(x => { x.Simple("ID", outerId); x.Simple("Name", name); x.Composite("CompositeValue", y => { y.Simple("Item1", 1); y.Simple("Item2", false); y.Composite("Item3", z => { z.Simple( "NestedItem1", "1"); z.Simple( "NestedItem2", 5.7); }); }); })); }); }
public void AddRow(int id, string name) { _tabularValue.Put(x => { x.Simple("ID", id); x.Simple("Name", name); }); }
/// <summary> /// Puts new row into tabular data instance. /// </summary> /// <param name="data">Tabular data instance.</param> /// <param name="rowBuilderAction">Action used to build new row.</param> /// <returns>This tabular data instance.</returns> public static ITabularData Put(this ITabularData data, Action <ICompositeDataBuilder> rowBuilderAction) { if (data == null) { throw new ArgumentNullException("data"); } if (rowBuilderAction == null) { throw new ArgumentNullException("rowBuilderAction"); } CompositeDataBuilder rowBuilder = new CompositeDataBuilder(data.TabularType.RowType); rowBuilderAction(rowBuilder); data.Put(rowBuilder.Create()); return(data); }
public void AddNestedRow(int outerId, int innerId, string name) { var nestedCompositeValue = new CompositeDataSupport(_nestedCompositeValueType, new[] { "NestedItem1", "NestedItem2" }, new object[] { "1", 5.7 }); var compositeValue = new CompositeDataSupport(_compositeValueType, new[] { "Item1", "Item2", "Item3" }, new object[] { 1, false, nestedCompositeValue }); var innerRow = new CompositeDataSupport(_innerTabularType.RowType, new[] { "ID", "Name", "CompositeValue" }, new object[] { outerId, name, compositeValue }); var innerTable = new TabularDataSupport(_innerTabularType); innerTable.Put(innerRow); var outerRow = new CompositeDataSupport(_outerTabularType.RowType, new[] { "ID", "Value" }, new object[] { innerId, innerTable }); _nestedTabularValue.Put(outerRow); }
public void AddRow(int id, string name) { _tabularValue.Put(new CompositeDataSupport(_tabularType.RowType, new[] { "ID", "Name" }, new object[] { id, name })); }