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

Add syntax highlighting to README #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, EmailAddress> { }

...
Expand All @@ -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> { }

```
Expand All @@ -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<string, ValidatedClientRef>
{
protected override void Validate()
Expand All @@ -46,4 +46,4 @@ public class ValidatedClientRef : ValueOf<string, ValidatedClientRef>

## 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.
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.