Skip to content

Commit 7e3ca87

Browse files
committed
Updated value object interfaces.
1 parent 1bdc3cf commit 7e3ca87

6 files changed

+7
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace LightResults.Extensions.ValueObjects;
22

33
public interface ICloneableValueObject<TSelf> : IValueObject<TSelf>
4-
where TSelf : struct
4+
where TSelf : notnull
55
{
66
TSelf Clone();
77
}

Diff for: src/LightResults.Extensions.ValueObjects/IConvertibleValueObject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace LightResults.Extensions.ValueObjects;
55
[SuppressMessage("Design", "CA1000: Do not declare static members on generic types", Justification = "This is required for handling value objects generically.")]
66
[SuppressMessage("Usage", "CA2252: This API requires opting into preview features", Justification = "This is meant to ensure conformity of value objects.")]
77
public interface IConvertibleValueObject<in TSource, TSelf> : IValueObject<TSelf>
8-
where TSelf : struct
8+
where TSelf : notnull
99
{
1010
static abstract TSelf Convert(TSource source);
1111
static abstract Result<TSelf> TryConvert(TSource source);

Diff for: src/LightResults.Extensions.ValueObjects/ICreatableValueObject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace LightResults.Extensions.ValueObjects;
55
[SuppressMessage("Design", "CA1000: Do not declare static members on generic types", Justification = "This is required for handling value objects generically.")]
66
[SuppressMessage("Usage", "CA2252: This API requires opting into preview features", Justification = "This is meant to ensure conformity of value objects.")]
77
public interface ICreatableValueObject<in TValue, TSelf> : IValueObject<TSelf>
8-
where TSelf : struct
8+
where TSelf : notnull
99
{
1010
static abstract TSelf Create(TValue value);
1111
static abstract Result<TSelf> TryCreate(TValue value);

Diff for: src/LightResults.Extensions.ValueObjects/IParsableValueObject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace LightResults.Extensions.ValueObjects;
55
[SuppressMessage("Design", "CA1000: Do not declare static members on generic types", Justification = "This is required for handling value objects generically.")]
66
[SuppressMessage("Usage", "CA2252: This API requires opting into preview features", Justification = "This is meant to ensure conformity of value objects.")]
77
public interface IParsableValueObject<TSelf> : IValueObject<TSelf>
8-
where TSelf : struct
8+
where TSelf : notnull
99
{
1010
static abstract TSelf Parse(string s);
1111
static abstract Result<TSelf> TryParse(string s);

Diff for: src/LightResults.Extensions.ValueObjects/IValueObject.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace LightResults.Extensions.ValueObjects;
44

55
public interface IValueObject<out TValue, TSelf> : IValueObject<TSelf>
6-
where TSelf : struct
6+
where TSelf : notnull
77
{
88
TValue Value { get; }
99
}
1010

1111
public interface IValueObject<TSelf> : IValueObject, IEquatable<TSelf>
12-
where TSelf : struct;
12+
where TSelf : notnull;
1313

1414
[SuppressMessage("Design", "CA1040: Avoid empty interfaces", Justification = "Used as a marker interface.")]
1515
public interface IValueObject;

Diff for: src/LightResults.Extensions.ValueObjects/LightResults.Extensions.ValueObjects.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<!-- Output -->
2525
<PropertyGroup>
2626
<AssemblyName>LightResults.Extensions.ValueObjects</AssemblyName>
27-
<Version>9.0.0-preview.2</Version>
27+
<Version>9.0.0-preview.3</Version>
2828
<AssemblyVersion>9.0.0.0</AssemblyVersion>
2929
<FileVersion>9.0.0.0</FileVersion>
3030
<NeutralLanguage>en-US</NeutralLanguage>

0 commit comments

Comments
 (0)