public static void Validate(this UpdateFeatureCommand command) { command.Required(nameof(command)); command.Name.Required(nameof(command.Name)); command.NewName.Required(nameof(command.NewName)); command.UpdatedBy.Required(nameof(command.UpdatedBy)); }
public static PathCreatedEvent ExtractPathCreatedEvent(this UpdateFeatureCommand command, ISystemClock clock) { return(new PathCreatedEvent { CreatedBy = command.UpdatedBy, CreatedOn = clock.UtcNow, Path = command.NewPath, FeatureAdded = command.NewName, }); }
public static PathRemovedEvent ExtractPathRemovedEvent(this UpdateFeatureCommand command, ISystemClock clock) { return(new PathRemovedEvent { RemovedBy = command.UpdatedBy, RemovedOn = clock.UtcNow, Path = command.Path, FeatureRemoved = command.Name, }); }
public static FeatureUpdatedEvent ExtractFeatureUpdatedEvent(this UpdateFeatureCommand command, ISystemClock clock) { return(new FeatureUpdatedEvent { Name = command.Name, Path = command.Path, NewName = command.NewName, NewPath = command.NewPath, UpdatedBy = command.UpdatedBy, UpdatedOn = clock.UtcNow, }); }