Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Develop Branch that Includes Detailed Examples for Multiple Extensions #28

Merged
merged 37 commits into from
Apr 13, 2020
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
245e782
Merge branch 'master' into develop
hf-kklein Mar 17, 2020
7c326e3
remove files
hf-kklein Mar 17, 2020
aab752c
Revert "remove intermediate doc trigger (as docs are actually built h…
hf-kklein Mar 17, 2020
48f01b9
remove build process irtself
hf-kklein Mar 17, 2020
36b5e77
remove unused files
hf-kklein Mar 17, 2020
2668654
trigger docs only on master commit
hf-kklein Mar 17, 2020
0b5e03b
Merge branch 'master' into develop
hf-kklein Mar 17, 2020
d0dadaf
Merge branch 'master' into develop
hf-kklein Mar 17, 2020
93d1a38
add JSON.net schemas to repository
hf-kklein Mar 18, 2020
00b6837
add link to official json.net schema docs
hf-kklein Mar 18, 2020
714bd68
catch license exception
hf-kklein Mar 18, 2020
1828ad6
check if userProperties are null
JoschaMetze Mar 19, 2020
ff0c219
Auto stash before merge of "develop" and "origin/develop" (#26)
hamidd30 Mar 26, 2020
3ad0ce8
fix outdated exception testing
hf-kklein Mar 26, 2020
6c2fc10
Merge remote-tracking branch 'origin/develop' into develop
hf-kklein Mar 26, 2020
8cb6d74
move stuff out of obsolete class
hf-kklein Mar 26, 2020
4780de7
modularize more stuff originally from deprecated BoMapper class
hf-kklein Mar 27, 2020
7a54650
Version 0.2.0: All public components now use Properties instead of fi…
hf-kklein Mar 27, 2020
1bda252
add all json schema and protobuf files as content files to solution
hf-kklein Apr 6, 2020
1eb2135
fix wrong pathes
hf-kklein Apr 6, 2020
61876b5
generate all the puml files
hf-kklein Apr 6, 2020
d10ee28
move json-schema files out of solution again
hf-kklein Apr 6, 2020
1505a0d
fix broken link
hf-kklein Apr 6, 2020
557e845
Explain usage of proto files
hf-kklein Apr 6, 2020
88579f8
remove fixed version in csproj, otherwise it will not generate suffix
JoschaMetze Apr 6, 2020
43ff5d6
but should have bumped the prefix in the same commit
JoschaMetze Apr 6, 2020
1f519ef
Anrede should be upper case in GP
JoschaMetze Apr 6, 2020
c0f9190
Zwischenstand GRPC (was ein Mist ;))
JoschaMetze Apr 6, 2020
542006c
add showcase tests for github
hf-kklein Apr 9, 2020
dd18998
Update README.md
hf-kklein Apr 9, 2020
89d5b72
Merge remote-tracking branch 'origin/develop' into develop
hf-kklein Apr 9, 2020
57a704c
add coverlet nuget to all test projects
hf-kklein Apr 9, 2020
929c4c3
Update README.md
hf-kklein Apr 9, 2020
5f2d397
add a lot of show case tests
hf-kklein Apr 10, 2020
205ed3b
Add showcase for anonymizign
hf-kklein Apr 10, 2020
6b06918
fix broken links
hf-kklein Apr 10, 2020
718615b
Mannheim -> Grünwald
hf-kklein Apr 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
hf-kklein authored Apr 9, 2020

Unverified

This user has not yet uploaded their public signing key.
commit dd18998d40a4a2bfbed3608e3ff15c02bda9dfe5
50 changes: 28 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -29,62 +29,61 @@ using BO4E.ENUM;
// ...
var energiemenge = new Energiemenge()
{
lokationsId = "DE0123456789012345678901234567890",
lokationsTyp = LokationsTyp.MeLo,
energieverbrauch = new List<Verbrauch>()
LokationsId = "DE0123456789012345678901234567890",
LokationsTyp = LokationsTyp.MeLo,
Energieverbrauch = new List<Verbrauch>()
};
```
### Make use of built in validation methods
full source
### Make Use of Built in Validation Methods for German Location IDs
```c#
using BO4E.BO;
using BO4E.ENUM;
// ...
var malo = new Marktlokation()
{
marktlokationsId = "1235678901",
sparte = Sparte.STROM,
energierichtung = Energierichtung.AUSSP
MarktlokationsId = "1235678901",
Sparte = Sparte.STROM,
Energierichtung = Energierichtung.AUSSP
};
Assert.IsFalse(malo.IsValid()); // because the obligatory bilanzierungsmethode is not set
malo.bilanzierungsmethode = Bilanzierungsmethode.SLP;
Assert.IsTrue(malo.IsValid(checkId:false)); // because all obligatory fields are set
Assert.IsFalse(malo.IsValid()); // but the marklokationsId is still wrong
malo.marktlokationsId = "51238696781"; // matches the appropriate regex and has the right check sum
malo.MarktlokationsId = "51238696781"; // matches the appropriate regex and has the right check sum
Assert.IsTrue(malo.IsValid());
```

### Add custom fields via userProperties
### Add Custom Fields on the Fly via UserProperties
```c#
using BO4E.BO;
using Newtonsoft.Json;
// ...
string meloJson = @"{'messlokationsId': 'DE0123456789012345678901234567890', 'sparte': 'STROM', 'myCustomInfo': 'some_value_not_covered_by_bo4e', 'myCustomValue': 123.456}";
var melo = JsonConvert.DeserializeObject<Messlokation>(meloJson);
Assert.IsTrue(melo.IsValid());
Assert.IsNotNull(melo.userProperties);
Assert.AreEqual("some_value_not_covered_by_bo4e", melo.userProperties["myCustomInfo"].ToObject<string>());
Assert.AreEqual(123.456M, melo.userProperties["myCustomValue"].ToObject<decimal>());
Assert.IsNotNull(melo.UserProperties);
Assert.AreEqual("some_value_not_covered_by_bo4e", melo.UserProperties["myCustomInfo"].ToObject<string>());
Assert.AreEqual(123.456M, melo.UserProperties["myCustomValue"].ToObject<decimal>());
```

### Don't write your own logic for basic operations
### Don't Write Your Own Logic for Basic Operations
```c#
using BO4E.COM;
using BO4E.ENUM;
// ...
var v1 = new Verbrauch()
{
einheit = Mengeneinheit.KWH,
obiskennzahl = "1-1:1.8.0",
startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),
enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)
Einheit = Mengeneinheit.KWH,
Obiskennzahl = "1-1:1.8.0",
Startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),
Enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)
};
var v2 = new Verbrauch()
{
einheit = Mengeneinheit.KWH,
obiskennzahl = "1-1:1.8.0",
startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),
enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)
Einheit = Mengeneinheit.KWH,
Obiskennzahl = "1-1:1.8.0",
Startdatum = new DateTime(2019, 1, 1, 0, 0, 0, DateTimeKind.Utc),
Enddatum = new DateTime(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc)
};

Assert.AreEqual(v1, v2);
@@ -93,6 +92,13 @@ Assert.AreEqual(v1.GetHashCode(), v2.GetHashCode());
Assert.IsFalse(v1 == v2);
```

### Feature Rich Extension Packages
Using the [Hochfrequenz.BO4E.Extensions](https://www.nuget.org/packages/Hochfrequenz.BO4E.Extensions/) gives you access to powerful analysis methods for Business Objects. We present them directly as executable show case tests.

* [Energiemenge](/TestBO4E-dotnet-Extensions/ShowCaseTests/EnergiemengeShowCaseTests.cs)

### Impressive Test Coverage

## Batteries Included
We try to make the usage of BO4E in general and this library in particular as smooth as possible. Therefore it not only includes bare C\# files but also some extra ressources that might be usefule to you.