public class CustomerId : ValueObject
{
public override Validation Validate() => Value > 0
? Validation.Ok
: Validation.Invalid("Customer IDs cannot be zero or negative.");
}
public void DoSomething(CustomerId customerId, SupplierId supplierId, Amount amount)
public void DoSomething(int customerId, int supplierId, int amount)
var customerId = CustomerId.From(42);
int customerId = 42;
public class CustomerId : ValueObject
{
}
public override Validation Validate() => Value > 0
? Validation.Ok
: Validation.Invalid("Customer IDs cannot be zero or negative.");
public void DoSomething(CustomerId customerId, SupplierId supplierId, Amount amount)
public void DoSomething(int customerId, int supplierId, int amount)
var customerId = CustomerId.From(42);
int customerId = 42;
public class CustomerId : ValueObject
{
}
Top-Level Directory Explanations
samples/ - This directory contains example projects demonstrating the usage of StringlyTyped library.
src/ - This directory contains the source code of the StringlyTyped library.
tests/ - This directory contains unit tests for the StringlyTyped library. It includes benchmark tests and small tests.