-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
756da27
commit fdee52d
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Zebus Message DSL | ||
|
||
This is a DSL which simplifies the writing of ProtoBuf contracts for [Zebus](https://github.com/Abc-Arbitrage/Zebus). | ||
|
||
See the [GitHub repository](https://github.com/Abc-Arbitrage/Zebus.MessageDsl) for more information. | ||
|
||
## Example | ||
|
||
Input file: | ||
|
||
```C# | ||
SomeMessage(int foo, string[] bar) | ||
``` | ||
|
||
Generated code: | ||
|
||
```C# | ||
[ProtoContract] | ||
public sealed partial class SomeMessage : IEvent | ||
{ | ||
[ProtoMember(1, IsRequired = true)] | ||
public int Foo { get; private set; } | ||
|
||
[ProtoMember(2, IsRequired = false)] | ||
public string[] Bar { get; private set; } | ||
|
||
private SomeMessage() | ||
{ | ||
Bar = Array.Empty<string>(); | ||
} | ||
|
||
public SomeMessage(int foo, string[] bar) | ||
{ | ||
Foo = foo; | ||
Bar = bar; | ||
} | ||
} | ||
``` |