public static void Validate(this AssignIsBeforeStrategyToFeatureCommand command) { command.Required(nameof(command)); command.Name.Required(nameof(command.Name)); command.Value.Required(nameof(command.Value)); command.AssignedBy.Required(nameof(command.AssignedBy)); }
public static StrategyAssignedEvent ExtractStrategyAssignedEvent( this AssignIsBeforeStrategyToFeatureCommand command, ISystemClock clock, IStrategySettingsSerializer serializer) { return(new StrategyAssignedEvent { Name = command.Name, Path = command.Path, AssignedBy = command.AssignedBy, AssignedOn = clock.UtcNow, StrategyName = StrategyNames.IsBefore, Settings = serializer.Serialize(new DateTimeOffsetStrategySettings { Value = command.Value }) }); }