public static void Validate(this AssignIsLowerThanStrategyToFeatureCommand 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 AssignIsLowerThanStrategyToFeatureCommand command, ISystemClock clock, IStrategySettingsSerializer serializer) { return(new StrategyAssignedEvent { Name = command.Name, Path = command.Path, AssignedBy = command.AssignedBy, AssignedOn = clock.UtcNow, StrategyName = StrategyNames.IsLowerThan, Settings = serializer.Serialize(new NumericalStrategySettings() { Value = command.Value }) }); }