From 8ce305da61a8e51968903ab77ddd8f7e7c16bcc2 Mon Sep 17 00:00:00 2001 From: John Meyer <20781397+0x326@users.noreply.github.com> Date: Tue, 27 Dec 2022 15:06:12 -0600 Subject: [PATCH] Add syntax highlighting --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6187c7a..df46357 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ValueOf lets you define ValueObject Types in a single line of code. Use them everywhere to strengthen your codebase. -``` +```csharp public class EmailAddress : ValueOf { } ... @@ -23,7 +23,7 @@ The ValueOf class implements `.Equals` and `.GetHashCode()` for you. You can use C# 7 Tuples for more complex Types with multiple values: -``` +```csharp public class Address : ValueOf<(string firstLine, string secondLine, Postcode postcode), Address> { } ``` @@ -32,7 +32,7 @@ You can use C# 7 Tuples for more complex Types with multiple values: You can add validation to your Types by overriding the `protected void Validate() { } ` method: -``` +```csharp public class ValidatedClientRef : ValueOf { protected override void Validate() @@ -46,4 +46,4 @@ public class ValidatedClientRef : ValueOf ## See Also -If you liked this, you'll probably like another project of mine [OneOf](https://github.com/mcintyre321/OneOf) which provides Discriminated Unions for C#, allowing stronger compile time guarantees when writing branching logic. \ No newline at end of file +If you liked this, you'll probably like another project of mine [OneOf](https://github.com/mcintyre321/OneOf) which provides Discriminated Unions for C#, allowing stronger compile time guarantees when writing branching logic.