From d0f2c9150c120d0cbfb47baaeca117a47fb00a14 Mon Sep 17 00:00:00 2001 From: Mario Ramos Date: Tue, 15 Oct 2024 09:53:36 +0200 Subject: [PATCH 1/5] Add `AtLeastOneRequiredAttribute` --- CHANGELOG.md | 1 + Directory.Build.props | 2 +- .../AtLeastOneRequiredAttribute.cs | 84 +++++++++++++++++++ .../DataAnnotations/RequiredIfAttribute.cs | 2 +- .../ValudationResultMessages.Designer.cs | 15 +++- .../Resources/ValudationResultMessages.resx | 5 +- 6 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 src/Encamina.Enmarcha.Core/DataAnnotations/AtLeastOneRequiredAttribute.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index a73aa88..91b540a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Previous classification is not required if changes are simple or all belong to t ### Minor Changes - Added the `AuthenticationRequired` property to `SmtpClientOptions.cs`, which is set to `true` by default. This indicates that authentication is required to connect to the SMTP server. If set to `false`, the server does not require authentication, meaning no username or password is needed for the connection. +- Added the `AtLeastOneRequiredAttribute` Data Annotation to validate that at least one of the specified properties has a value. ## [8.1.8] diff --git a/Directory.Build.props b/Directory.Build.props index fcdc636..d73daf7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,7 +17,7 @@ 8.1.9 - preview-01 + preview-02