Skip to content

Commit 412d26b

Browse files
authored
Merge pull request #4 from mbsoftlab/develop
Develop v1.0.7
2 parents 1d9b76f + b581ddc commit 412d26b

4 files changed

Lines changed: 28 additions & 248 deletions

File tree

MbSoftLab.TemplateEngine.Core/MbSoftLab.TemplateEngine.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyVersion>1.0.7.0</AssemblyVersion>
66
<FileVersion>1.0.7.0</FileVersion>
77
<Version>1.0.7</Version>
8-
<PackageVersion>1.0.7-preview</PackageVersion>
8+
<PackageVersion>1.0.7</PackageVersion>
99
<Description>This StringTemplateEngine can replace values from Classpropertys and methods in stringtemplates</Description>
1010
<DocumentationFile>Documentation.xml</DocumentationFile>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

MbSoftLab.TemplateEngine.Core/README.md

Lines changed: 0 additions & 213 deletions
This file was deleted.

MbSoftLab.TemplateEngine.Core/TemplateEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class TemplateEngine<T>
4343
public string CloseingDelimiter { get=>_closeingDelimiter; set=>_closeingDelimiter=value.Trim(); }
4444
private string _closeingDelimiter = "}";
4545
/// <summary>
46-
/// Datenmodell mit Propertys zum befüllen der ${PlaceholderPropertys} im Template. Name der Propertys im DataModel muss den Namen in den ${Placeholder} entsprechen
46+
/// Model with propertys to fill ${PlaceholderPropertys} in the template. The propertynames at DataModel has to be equal with ${Placeholder}
4747
/// </summary>
4848
public T TemplateDataModel { get => _templateDataModel; set => _templateDataModel = value; }
4949
T _templateDataModel;

README.md

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# MbSoftLab.TemplateEngine.Core
2+
3+
![BuildFromDevelop](https://github.com/mbsoftlab/MbSoftLab.TemplateEngine.Core/workflows/BuildFromDevelop/badge.svg?branch=develop) ![BuildFromMaster](https://github.com/mbsoftlab/MbSoftLab.TemplateEngine.Core/workflows/BuildFromMaster/badge.svg?branch=master)![Release](https://github.com/mbsoftlab/MbSoftLab.TemplateEngine.Core/workflows/Release/badge.svg)
4+
5+
*Codequality (master branch)*
6+
[![CodeFactor](https://www.codefactor.io/repository/github/mbsoftlab/mbsoftlab.templateengine.core/badge)](https://www.codefactor.io/repository/github/mbsoftlab/mbsoftlab.templateengine.core)
7+
8+
*Codequality (develop branch)*
9+
[![CodeFactor](https://www.codefactor.io/repository/github/mbsoftlab/mbsoftlab.templateengine.core/badge/develop)](https://www.codefactor.io/repository/github/mbsoftlab/mbsoftlab.templateengine.core/overview/develop)
210
```csharp
311
namespace MbSoftLab.TemplateEngine.Core
412
{
@@ -21,8 +29,7 @@ Also you can access parameterless public methods of TemplateDataModell classes b
2129

2230

2331
The default is `${` for the start delimiter and `}` for the end delimiter.
24-
25-
![picture of what can done by the TemplateEngine](https://mbsoftlab.bitbucket.io/MbSoftlab.TemplateEngine.Core/ProblemDescription.PNG "What the Engine can do")
32+
2633

2734
```csharp
2835
Person person = new Person
@@ -75,6 +82,7 @@ PM> Install-Package MbSoftLab.TemplateEngine.Core
7582
|`TemplateDataModel` |Generic / object |Modell with Properys for Dataholding |
7683
|`TemplateString` |string |Templatestring |
7784
|`NullStringValue` |string |String for NULL-Values |
85+
|`CultureInfo` |CultureInfo |Culture for Double and DateTime values |
7886

7987
---
8088

@@ -85,24 +93,23 @@ PM> Install-Package MbSoftLab.TemplateEngine.Core
8593
// Create a modell Class for Data
8694
TemplateDataModel templateDataModel = new TemplateDataModel
8795
{
88-
ProjektName = "Projektname"
96+
ProjectName = "Projektname"
8997
};
9098

91-
string template = "<MyTag>${ProjektName}</MyTag>";
99+
string template = "<MyTag>${ProjectName}</MyTag>";
92100

93101
TemplateEngine templateEngine = new TemplateEngine(templateDataModel,template);
94102
string outputString = templateEngine.CreateStringFromTemplate();
95103

96-
Console.Write(outputString); // Ausgabe: <MyTag>Projektname</MyTag>
104+
Console.Write(outputString); // Output: <MyTag>ProjectName</MyTag>
97105
```
98106
### **Load template from file**
99107
```csharp
100108
TemplateDataModel templateDataModel = new TemplateDataModel
101109
{
102-
ProjektName = "Projektname",
103-
KundeNummer = "1234",
104-
ProjektLink = "https://google.de",
105-
ProjektKuerzel = "PKZL"
110+
ProjectName = "Projektname",
111+
CustomerId = "1234",
112+
ProjectUrl = "https://google.com"
106113
};
107114

108115
TemplateEngine templateEngine = new TemplateEngine(templateDataModel);
@@ -118,9 +125,8 @@ Console.Write(outputString); // Ausgabe: <MyTag>Projektname</MyTag>
118125
TemplateDataModel templateDataModel = new TemplateDataModel
119126
{
120127
ProjectName = "Projectname",
121-
KundeNummer = "1234",
122-
ProjektLink = "https://google.de",
123-
ProjektKuerzel = "PKZL"
128+
CustomerId = "1234",
129+
ProjectUrl = "https://google.com"
124130
};
125131

126132
string template = "<p>${ProjectName}</p>";
@@ -137,9 +143,8 @@ Console.Write(outputString); // Ausgabe: <MyTag>Projektname</MyTag>
137143
TemplateDataModel templateDataModel = new TemplateDataModel
138144
{
139145
ProjectName = "Projectname",
140-
KundeNummer = "1234",
141-
ProjektLink = "https://google.de",
142-
ProjektKuerzel = "PKZL"
146+
CustomerId = "1234",
147+
ProjectUrl = "https://google.com"
143148
};
144149

145150
string template = "<p>${ProjectName}</p>";
@@ -153,12 +158,11 @@ Console.Write(outputString); // Ausgabe: <MyTag>Projektname</MyTag>
153158
TemplateDataModel templateDataModel = new TemplateDataModel
154159
{
155160
ProjectName = "Projectname",
156-
KundeNummer = null,
157-
ProjektLink = "https://google.de",
158-
ProjektKuerzel = "KZ"
161+
CustomerId = null,
162+
ProjectUrl = "https://google.de"
159163
};
160164

161-
string template = "<p>{{ProjectName}}</p><p>{{KundeNummer}}</p>";
165+
string template = "<p>{{ProjectName}}</p><p>{{CustomerId}}</p>";
162166
TemplateEngine<TemplateDataModel> templateEngine = new TemplateEngine<TemplateDataModel>()
163167
{
164168
TemplateDataModel = templateDataModel,
@@ -202,22 +206,11 @@ Console.Write(outputString); // Ausgabe: <MyTag>Projektname</MyTag>
202206

203207
---
204208

205-
## Repository
206-
207-
https://bitbucket.org/MbSoftLab/mbsoftlab.templateengine/src/master/
209+
## Repo
208210

211+
https://github.com/mbsoftlab/MbSoftLab.TemplateEngine.Core
209212
---
210213

211214
## Issues
212215

213-
[report an issue](https://bitbucket.org/MbSoftLab/mbsoftlab.templateengine/issues?status=new&status=open)
214-
215-
216-
---
217-
## License
218-
219-
Code licensed under [MIT](https://licenses.nuget.org/MIT)
220-
221-
Documentation licensed under [CC BY 4.0.](https://creativecommons.org/licenses/by/4.0/)
222-
223-
216+
[report an issue](https://github.com/mbsoftlab/MbSoftLab.TemplateEngine.Core/issues)

0 commit comments

Comments
 (0)