IStronglyTypedId Interface
Provides non-generic access to a strongly-typed ID's underlying value as a string and its type information.
public interface IStronglyTypedIdExample
Working with strongly-typed IDs polymorphically:
[StronglyTypedId(typeof(int))]
public partial struct UserId
{
}var userId = UserId.FromInt32(42);
IStronglyTypedId stronglyTypedId = userId;
Assert.Equal("42", stronglyTypedId.ValueAsString);
Assert.Equal(typeof(int), stronglyTypedId.UnderlyingType);Properties
| Name | Description |
|---|---|
| UnderlyingType | Gets the underlying type of the strongly-typed ID value. |
| ValueAsString | Gets the underlying value as a string representation. |