Skip to content

Commit 6ec3ff6

Browse files
authored
Update README.md
1 parent 91eda7b commit 6ec3ff6

1 file changed

Lines changed: 35 additions & 12 deletions

File tree

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ This is especially useful when you want to dynamically generate content such as:
1313
- Reports or invoices
1414
- Config files
1515
- Logging output
16-
17-
It supports:
18-
- ✅ Plain object property injection (`{{ PropertyName }}`)
19-
- ✅ Additional external parameters
20-
- ✅ Enumerable collections with looping (`#foreach`)
21-
- ✅ Built-in string, date, and number formatting
22-
2316
---
2417

2518
## 📦 Installation
@@ -71,8 +64,8 @@ Student student = new Student
7164
StudentName = "John Doe",
7265
Invoices = new List<Invoice>
7366
{
74-
new Invoice { Id = 2, RefNo = "INV_002", Narration = "Grade II Fees Invoice", Amount = 2000, InvoiceDate = new DateTime(2023, 04, 01) },
75-
new Invoice { Id = 1, RefNo = "INV_001", Narration = "Grade I Fees Invoice", Amount = 320, InvoiceDate = new DateTime(2022, 08, 01) }
67+
new Invoice { Id = 2, RefNo = "INV_002", Narration = "Grade II Fees", Amount = 2000, InvoiceDate = new DateTime(2023, 04, 01) },
68+
new Invoice { Id = 1, RefNo = "INV_001", Narration = "Grade I Fees", Amount = 320, InvoiceDate = new DateTime(2022, 08, 01) }
7669
}
7770
};
7871

@@ -102,24 +95,54 @@ John Doe Invoices
10295
<tr>
10396
<td>2</td>
10497
<td>INV_002</td>
105-
<td>Grade II Fees Invoice</td>
98+
<td>Grade II Fees</td>
10699
<td>2,000</td>
107100
<td>2023-04-01</td>
108101
</tr>
109102
110103
<tr>
111104
<td>1</td>
112105
<td>INV_001</td>
113-
<td>Grade I Fees Invoice</td>
106+
<td>Grade I Fees</td>
114107
<td>320</td>
115108
<td>2022-08-01</td>
116109
</tr>
117110
```
118111

119112
---
120113

121-
## 🧪 More Samples
114+
### Example 3: String Formatters
115+
116+
Use format like `uppercase`, `lowercase`, `titlecase`, `length`.
117+
118+
```csharp
119+
FileContents = "Uppercase: {{ StudentName:uppercase }}, Length: {{ StudentName:length }}"
120+
```
121+
Outputs:
122+
123+
```
124+
Uppercase: ALICE, Length: 5
125+
```
122126

127+
---
128+
129+
### Example 4: If Conditionals (`if`)
130+
131+
```csharp
132+
FileContents = @"
133+
{{ if Age >= 18 }}
134+
Adult
135+
{{ else }}
136+
Minor
137+
{{ end }}"
138+
```
139+
Outputs:
140+
141+
```
142+
Adult
143+
```
144+
145+
---
123146
Explore more usage examples and edge cases in the test project:
124147

125148
📁 [`ObjectSemantics.NET.Tests`](./ObjectSemantics.NET.Tests)

0 commit comments

Comments
 (0)