Exemple #1
0
 public static void Validate(this AssignIsAfterStrategyToFeatureCommand command)
 {
     command.Required(nameof(command));
     command.Name.Required(nameof(command.Name));
     command.Value.Required(nameof(command.Value));
     command.AssignedBy.Required(nameof(command.AssignedBy));
 }
Exemple #2
0
 public static StrategyAssignedEvent ExtractStrategyAssignedEvent(
     this AssignIsAfterStrategyToFeatureCommand command,
     ISystemClock clock,
     IStrategySettingsSerializer serializer)
 {
     return(new StrategyAssignedEvent
     {
         Name = command.Name,
         Path = command.Path,
         AssignedBy = command.AssignedBy,
         AssignedOn = clock.UtcNow,
         StrategyName = StrategyNames.IsAfter,
         Settings = serializer.Serialize(new DateTimeOffsetStrategySettings
         {
             Value = command.Value
         })
     });
 }