@@ -16,41 +16,41 @@ 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 ) ;
4242
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);
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 ) ;
5050
5151 // Example using OneOf / swapping a source for a query
5252 stringTemplate = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\TemplateSampleCalculation.handlebars" ) ;
53- var template = Handlebars . Compile ( stringTemplate ) ;
53+ template = Handlebars . Compile ( stringTemplate ) ;
5454 jsonInput = File . ReadAllText ( AppDomain . CurrentDomain . BaseDirectory + @"..\..\sampleCalculation.json" ) ;
5555 deserialisedMapping = JsonConvert . DeserializeObject < DataObjectMappings > ( jsonInput ) ;
5656 result = template ( deserialisedMapping ) ;
0 commit comments