public static StrategyAssignedEvent ExtractStrategyAssignedEvent( this AssignIsInListStrategyToFeatureCommand command, ISystemClock clock, IStrategySettingsSerializer serializer) { return(new StrategyAssignedEvent { Name = command.Name, Path = command.Path, AssignedBy = command.AssignedBy, AssignedOn = clock.UtcNow, StrategyName = StrategyNames.IsInList, Settings = serializer.Serialize(new IsInListStrategySettings { Items = command.Items, ListName = command.ListName }) }); }
public static void Validate(this AssignIsInListStrategyToFeatureCommand command) { command.Required(nameof(command)); command.Name.Required(nameof(command.Name)); command.AssignedBy.Required(nameof(command.AssignedBy)); }