Esempio n. 1
0
        public static IServiceCollection AddDevCommands(
            this IServiceCollection @this, IConfiguration config = null, Action <DevCommandsOptions> options = null)
        {
            if (config?.GetValue("PredictableGuidEnabled", defaultValue: false) == true)
            {
                PredictableGuidGenerator.Reset("Default");
                Entities.GuidEntity.NewIdGenerator = PredictableGuidGenerator.Generate;
            }
            @this.AddSingleton <IDevCommand, TestContextDevCommand>();
            @this.AddSingleton <IDevCommand, InjectTimeDevCommand>();
            @this.AddSingleton <IDevCommand, DatabaseClearCacheDevCommand>();

            options?.Invoke(new DevCommandsOptions(@this));

            return(@this);
        }
Esempio n. 2
0
 public override Task <string> Run()
 {
     PredictableGuidGenerator.Reset(Param("name"));
     return(Task.FromResult(string.Empty));
 }