From 7477b7da9aeed4e3d83c62d56cc467ebea10cfb9 Mon Sep 17 00:00:00 2001 From: Simon Jefferies Date: Tue, 26 Nov 2024 10:36:05 +0000 Subject: [PATCH] Add SetsRequiredMembersAttribute class - Added `SetsRequiredMembersAttribute.cs` defining a new attribute class `SetsRequiredMembersAttribute` in the `System.Diagnostics.CodeAnalysis` namespace. - Updated `MissingAttributes.csproj` to include the new file for the `net6.0` target framework. - The attribute is designed for constructors, marked as `sealed`, and cannot be used multiple times on the same constructor or inherited by derived classes. --- MissingAttributes/MissingAttributes.csproj | 1 + MissingAttributes/SetsRequiredMembersAttribute.cs | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 MissingAttributes/SetsRequiredMembersAttribute.cs diff --git a/MissingAttributes/MissingAttributes.csproj b/MissingAttributes/MissingAttributes.csproj index 7bdb807..83f29ce 100644 --- a/MissingAttributes/MissingAttributes.csproj +++ b/MissingAttributes/MissingAttributes.csproj @@ -21,6 +21,7 @@ + diff --git a/MissingAttributes/SetsRequiredMembersAttribute.cs b/MissingAttributes/SetsRequiredMembersAttribute.cs new file mode 100644 index 0000000..3c06586 --- /dev/null +++ b/MissingAttributes/SetsRequiredMembersAttribute.cs @@ -0,0 +1,6 @@ +namespace System.Diagnostics.CodeAnalysis; + +[System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] +public sealed class SetsRequiredMembersAttribute : Attribute +{ +}