public RunDomainEntity Stop(BuildDomainEntity build) { if (StartedAt == null) { throw new Exception($"Run not started."); } EndedAt = DateTime.UtcNow; return(this); }
public RunDomainEntity Start(BuildDomainEntity build) { if (StartedAt != null || EndedAt != null) { throw new Exception($"Run already performed."); } StartedAt = DateTime.UtcNow; return(this); }