Skip to content

Commit 9dfd9a1

Browse files
authored
Update README.md
1 parent 3fa8110 commit 9dfd9a1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Also take a look into others packages:</br>
4444
## GeneratorModel Structure:
4545

4646
**Class Inheritance Hierarchy**
47-
````csharp
47+
```csharp
4848
|-* BaseElement
4949
ClassModel : -----|
5050
Property : -- Field : ----------|
@@ -84,7 +84,7 @@ CsGenerator
8484
|
8585
|---NestedClasses (recursively)
8686
|--- ...
87-
````
87+
```
8888

8989
## How to use it
9090
Following is first example of ComplexNumber class and then creating its ClassModel for writing to Complex.cs
@@ -93,7 +93,7 @@ There are 2 option to configure it:
9393
-and other with pure classes and properties (B)
9494

9595
Class we want to generate:
96-
````csharp
96+
```csharp
9797
using System;
9898
using System.Model;
9999

@@ -147,12 +147,12 @@ namespace CsCodeGenerator.Tests
147147
}
148148
}
149149
}
150-
````
150+
```
151151

152-
A) Code to do it with Fluent methods [***With**Element()* such as `WithProperty`]:
152+
A) Code to do it with Fluent methods - shorter code and more readable syntax. [***With**Element()* such as `WithProperty`].
153153
Fluent calls are composed with BaseElement, when configuring deeper level we need to instanciate with New and call in the scope.
154154
To be able to get subElements returned to main scope (like EFCore FluentAPI setting works) then more extension methods would be needed - one example is commented in source code: `WithPropertyReturn`.
155-
````csharp
155+
```csharp
156156
var usingDirectives = new List<string>
157157
{
158158
"System;",
@@ -211,10 +211,10 @@ complexNumberFile.Classes.Add(complexNumberClass);
211211
var csGenerator = new CsGenerator();
212212
csGenerator.Files.Add(complexNumberFile);
213213
csGenerator.CreateFiles();
214-
````
214+
```
215215

216216
B) Alternative way without Fluent:
217-
````csharp
217+
```csharp
218218
var usingDirectives = new List<string>
219219
{
220220
"using System;",
@@ -307,4 +307,4 @@ complexNumberFile.Classes.Add(complexNumberClass.Name, complexNumberClass);
307307
CsGenerator csGenerator = new CsGenerator();
308308
csGenerator.Files.Add(complexNumberFile.Name, complexNumberFile);
309309
csGenerator.CreateFiles(); //Console.Write(complexNumberFile);
310-
````
310+
```

0 commit comments

Comments
 (0)