@@ -16,34 +16,42 @@ static void Main(string[] args)
1616 string result = "" ;
1717 DataObjectMappings deserialisedMapping = new DataObjectMappings ( ) ;
1818
19- // Simple example template
20- stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleBasic.handlebars" ) ;
21- var template = Handlebars . Compile ( stringTemplate ) ;
22- jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleBasic.json" ) ;
23- deserialisedMapping = JsonConvert . DeserializeObject < DataObjectMappings > ( jsonInput ) ;
24- result = template ( deserialisedMapping ) ;
25- Console . WriteLine ( result ) ;
19+ //// Simple example template
20+ // stringTemplate = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\TemplateSampleBasic.handlebars");
21+ // var template = Handlebars.Compile(stringTemplate);
22+ // jsonInput = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\sampleBasic.json");
23+ // deserialisedMapping = JsonConvert.DeserializeObject<DataObjectMappings>(jsonInput);
24+ // result = template(deserialisedMapping);
25+ // Console.WriteLine(result);
2626
27- // Example using extensions
28- stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleBasicWithExtensions.handlebars" ) ;
29- template = Handlebars . Compile ( stringTemplate ) ;
30- jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleBasicWithExtensions.json" ) ;
31- deserialisedMapping = JsonConvert . DeserializeObject < DataObjectMappings > ( jsonInput ) ;
32- result = template ( deserialisedMapping ) ;
33- Console . WriteLine ( result ) ;
27+ //// Example using extensions
28+ // stringTemplate = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\TemplateSampleBasicWithExtensions.handlebars");
29+ // template = Handlebars.Compile(stringTemplate);
30+ // jsonInput = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\sampleBasicWithExtensions.json");
31+ // deserialisedMapping = JsonConvert.DeserializeObject<DataObjectMappings>(jsonInput);
32+ // result = template(deserialisedMapping);
33+ // Console.WriteLine(result);
3434
35- // Example using more than one mapping at data item level
36- stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleMultipleDataItemMappings.handlebars" ) ;
37- template = Handlebars . Compile ( stringTemplate ) ;
38- jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleMultipleDataItemMappings.json" ) ;
39- deserialisedMapping = JsonConvert . DeserializeObject < DataObjectMappings > ( jsonInput ) ;
40- result = template ( deserialisedMapping ) ;
41- Console . WriteLine ( result ) ;
35+ //// Example using more than one mapping at data item level
36+ //stringTemplate = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\TemplateSampleMultipleDataItemMappings.handlebars");
37+ //template = Handlebars.Compile(stringTemplate);
38+ //jsonInput = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\sampleMultipleDataItemMappings.json");
39+ //deserialisedMapping = JsonConvert.DeserializeObject<DataObjectMappings>(jsonInput);
40+ //result = template(deserialisedMapping);
41+ //Console.WriteLine(result);
42+
43+ //// Example generating DDL statements
44+ //stringTemplate = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\TemplateSampleSimpleDDL.handlebars");
45+ //template = Handlebars.Compile(stringTemplate);
46+ //jsonInput = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + @"..\..\sampleSimpleDDL.json");
47+ //deserialisedMapping = JsonConvert.DeserializeObject<DataObjectMappings>(jsonInput);
48+ //result = template(deserialisedMapping);
49+ //Console.WriteLine(result);
4250
43- // Example generating DDL statements
44- stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleSimpleDDL .handlebars" ) ;
45- template = Handlebars . Compile ( stringTemplate ) ;
46- jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleSimpleDDL .json" ) ;
51+ // Example using OneOf / swapping a source for a query
52+ stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleCalculation .handlebars" ) ;
53+ var template = Handlebars . Compile ( stringTemplate ) ;
54+ jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleCalculation .json" ) ;
4755 deserialisedMapping = JsonConvert . DeserializeObject < DataObjectMappings > ( jsonInput ) ;
4856 result = template ( deserialisedMapping ) ;
4957 Console . WriteLine ( result ) ;
0 commit comments