Ejemplo n.º 1
0
            public GetMigrations([NotNull] OperationExecutor executor, [NotNull] object resultHandler, [NotNull] IDictionary args)
                : base(resultHandler)
            {
                Check.NotNull(executor, nameof(executor));
                Check.NotNull(args, nameof(args));

                var contextType = (string)args["contextType"];

                Execute(() => executor.GetMigrationsImpl(contextType));
            }
Ejemplo n.º 2
0
            /// <summary>
            ///     <para>Initializes a new instance of the <see cref="GetMigrations" /> class.</para>
            ///     <para>The arguments supported by <paramref name="args" /> are:</para>
            ///     <para><c>contextType</c>--The <see cref="DbContext" /> to use.</para>
            ///     <para><c>connectionString</c>--The connection string to the database. Defaults to the one specified in <see cref="O:Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.AddDbContext"/> or <see cref="DbContext.OnConfiguring"/>.</para>
            ///     <para><c>noConnect</c>--Don't connect to the database.</para>
            /// </summary>
            /// <param name="executor"> The operation executor. </param>
            /// <param name="resultHandler"> The <see cref="IOperationResultHandler" />. </param>
            /// <param name="args"> The operation arguments. </param>
            public GetMigrations(
                [NotNull] OperationExecutor executor, [NotNull] IOperationResultHandler resultHandler, [NotNull] IDictionary args)
                : base(resultHandler)
            {
                Check.NotNull(executor, nameof(executor));
                Check.NotNull(args, nameof(args));

                var contextType      = (string)args["contextType"];
                var connectionString = (string)args["connectionString"];
                var noConnect        = (bool)(args["noConnect"] ?? true);

                Execute(() => executor.GetMigrationsImpl(contextType, connectionString, noConnect));
            }