Commit 3f21bde7 authored by Almouhannad's avatar Almouhannad

(B) Fix Gender create method

parent 964853eb
...@@ -31,11 +31,13 @@ public sealed class Gender : Entity ...@@ -31,11 +31,13 @@ public sealed class Gender : Entity
if (name is null) if (name is null)
throw new InvalidValuesDomainException<Gender>(); throw new InvalidValuesDomainException<Gender>();
if (id < 0)
throw new InvalidValuesDomainException<Gender>();
if (id is not null) if (id is not null)
{
if (id < 0)
throw new InvalidValuesDomainException<Gender>();
return new Gender(id.Value, name); return new Gender(id.Value, name);
}
return new Gender(0, name); return new Gender(0, name);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment