예제 #1
0
 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));
 }
예제 #2
0
 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
         })
     });
 }