From 29cea35a2af46d52a41f165da4d8df11ccf761db Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Mon, 27 Mar 2023 20:12:32 +0200 Subject: [PATCH 1/6] Add badges and tagline to README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 6187c7a..9368213 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,24 @@ # ValueOf +Deal with Primitive Obsession - define ValueObjects in a single line (of C#). + +--- + +[![mcintyre321 - ValueOf](https://img.shields.io/static/v1?label=mcintyre321&message=ValueOf&color=blue&logo=github)](https://github.com/mcintyre321/ValueOf "Go to GitHub repo") +[![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD--3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) +[![stars - ValueOf](https://img.shields.io/github/stars/mcintyre321/ValueOf?style=social)](https://github.com/mcintyre321/ValueOf) +[![forks - ValueOf](https://img.shields.io/github/forks/mcintyre321/ValueOf?style=social)](https://github.com/mcintyre321/ValueOf) + +[![issues - ValueOf](https://img.shields.io/github/issues/mcintyre321/ValueOf)](https://github.com/mcintyre321/ValueOf/issues) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/mcintyre321/ValueOf)](https://github.com/mcintyre321/ValueOf/pulls) +[![GitHub contributors](https://img.shields.io/github/contributors/mcintyre321/ValueOf)](https://github.com/mcintyre321/ValueOf/graphs/contributors) +[![GitHub last commit](https://img.shields.io/github/last-commit/mcintyre321/ValueOf)](https://github.com/mcintyre321/ValueOf/commits/master) + +[![NuGet](https://img.shields.io/nuget/v/ValueOf.svg)](https://www.nuget.org/packages/ValueOf) +[![NuGet](https://img.shields.io/nuget/dt/ValueOf.svg)](https://www.nuget.org/packages/ValueOf) + +--- + > install-package ValueOf ## What is this library From 758cd0c9b1a9173a90b63caf91eb00f4597604f4 Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Mon, 27 Mar 2023 20:13:30 +0200 Subject: [PATCH 2/6] Add syntax coloration to example --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9368213..905b495 100644 --- a/README.md +++ b/README.md @@ -29,29 +29,27 @@ Deal with Primitive Obsession - define ValueObjects in a single line (of C#). ValueOf lets you define ValueObject Types in a single line of code. Use them everywhere to strengthen your codebase. -``` +```csharp public class EmailAddress : ValueOf { } ... EmailAddress emailAddress = EmailAddress.From("foo@bar.com"); - ``` The ValueOf class implements `.Equals` and `.GetHashCode()` for you. You can use C# 7 Tuples for more complex Types with multiple values: -``` - public class Address : ValueOf<(string firstLine, string secondLine, Postcode postcode), Address> { } - +```csharp +public class Address : ValueOf<(string firstLine, string secondLine, Postcode postcode), Address> { } ``` ### Validation You can add validation to your Types by overriding the `protected void Validate() { } ` method: -``` +```csharp public class ValidatedClientRef : ValueOf { protected override void Validate() @@ -60,7 +58,6 @@ public class ValidatedClientRef : ValueOf throw new ArgumentException("Value cannot be null or empty"); } } - ``` ## See Also From d517121622a8cfde53437fd840893809a202254d Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Mon, 27 Mar 2023 20:13:54 +0200 Subject: [PATCH 3/6] Limits line width --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 905b495..a9a5002 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,13 @@ Deal with Primitive Obsession - define ValueObjects in a single line (of C#). ## What is this library -> The Smell: Primitive Obsession is using primitive data types to represent domain ideas. For example, we use a String to represent a message, an Integer to represent an amount of money, or a Struct/Dictionary/Hash to represent a specific object. -> The Fix: Typically, we introduce a ValueObject in place of the primitive data, then watch like magic as code from all over the system shows FeatureEnvySmell and wants to be on the new ValueObject. We move those methods, and everything becomes right with the world. +> The Smell: Primitive Obsession is using primitive data types to represent domain ideas. For example, we use a String +> to represent a message, an Integer to represent an amount of money, or a Struct/Dictionary/Hash to represent a +> specific +> object. +> The Fix: Typically, we introduce a ValueObject in place of the primitive data, then watch like magic as code from all +> over the system shows FeatureEnvySmell and wants to be on the new ValueObject. We move those methods, and everything +> becomes right with the world. > - http://wiki.c2.com/?PrimitiveObsession ValueOf lets you define ValueObject Types in a single line of code. Use them everywhere to strengthen your codebase. @@ -62,4 +67,5 @@ 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. \ No newline at end of file From 74d84c87494ec8026cb6365e3fbe7ff219072c74 Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Wed, 18 Feb 2026 20:39:46 +0000 Subject: [PATCH 4/6] chore: add Renovate configuration --- renovate.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..692ce4a --- /dev/null +++ b/renovate.json @@ -0,0 +1 @@ +{"$schema":"https://docs.renovatebot.com/renovate-schema.json","extends":["config:recommended"]} From e9ef669c4bc377cab780c6850346746152d98201 Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Mon, 9 Mar 2026 11:07:42 +0100 Subject: [PATCH 5/6] chore: standardize renovate config --- renovate.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 692ce4a..685713d 100644 --- a/renovate.json +++ b/renovate.json @@ -1 +1,30 @@ -{"$schema":"https://docs.renovatebot.com/renovate-schema.json","extends":["config:recommended"]} +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended"], + "baseBranchPatterns": ["dev"], + "schedule": ["before 9am on Saturday"], + "timezone": "Europe/Brussels", + "labels": ["dependencies", "renovate"], + "packageRules": [ + { + "description": "Automerge minor and patch updates", + "matchUpdateTypes": ["minor", "patch"], + "automerge": true, + "automergeType": "pr" + }, + { + "description": "Group all NuGet minor/patch updates together", + "matchManagers": ["nuget"], + "matchUpdateTypes": ["minor", "patch"], + "groupName": "NuGet minor/patch updates" + }, + { + "description": "Group all NuGet major updates together", + "matchManagers": ["nuget"], + "matchUpdateTypes": ["major"], + "groupName": "NuGet major updates", + "dependencyDashboardApproval": true + } + ], + "platformAutomerge": true +} \ No newline at end of file From 15403d6908c6e030460ea4594cc7728a5ca2ba1d Mon Sep 17 00:00:00 2001 From: Philippe Matray Date: Mon, 9 Mar 2026 11:18:16 +0100 Subject: [PATCH 6/6] chore: fix renovate config for repo technologies --- renovate.json | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/renovate.json b/renovate.json index 685713d..d11bbe8 100644 --- a/renovate.json +++ b/renovate.json @@ -1,27 +1,48 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:recommended"], - "baseBranchPatterns": ["dev"], - "schedule": ["before 9am on Saturday"], + "extends": [ + "config:recommended" + ], + "baseBranchPatterns": [ + "dev" + ], + "schedule": [ + "before 9am on Saturday" + ], "timezone": "Europe/Brussels", - "labels": ["dependencies", "renovate"], + "labels": [ + "dependencies", + "renovate" + ], "packageRules": [ { "description": "Automerge minor and patch updates", - "matchUpdateTypes": ["minor", "patch"], + "matchUpdateTypes": [ + "minor", + "patch" + ], "automerge": true, "automergeType": "pr" }, { "description": "Group all NuGet minor/patch updates together", - "matchManagers": ["nuget"], - "matchUpdateTypes": ["minor", "patch"], + "matchManagers": [ + "nuget" + ], + "matchUpdateTypes": [ + "minor", + "patch" + ], "groupName": "NuGet minor/patch updates" }, { "description": "Group all NuGet major updates together", - "matchManagers": ["nuget"], - "matchUpdateTypes": ["major"], + "matchManagers": [ + "nuget" + ], + "matchUpdateTypes": [ + "major" + ], "groupName": "NuGet major updates", "dependencyDashboardApproval": true }