Update Age.cs

This commit is contained in:
Meysam Hadeli 2023-06-02 16:57:17 +03:30 committed by GitHub
parent cd1d4fa7a0
commit eb82094919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,13 @@
namespace Passenger.Passengers.Models.ValueObjects;
using global::Passenger.Passengers.Exceptions;
namespace Passenger.Passengers.ValueObjects;
using Passenger.Passengers.Exceptions;
public record Age
{
public int Value { get; }
public Age(int value)
{
if (value <= 0 || value == null)
if (value <= 0)
{
throw new InvalidAgeException();
}