コード例 #1
0
            private static bool Check()
            {
                using var connection = DbRequirements.CreateDbConnection();
                using var command    = connection.CreateCommand();

                command.CommandText = CheckTable;
                var result = command.ExecuteScalar() != null;

                return(result);
            }
コード例 #2
0
            private static void Create()
            {
                using var connection = DbRequirements.CreateDbConnection();
                using var command    = connection.CreateCommand();

                command.CommandText = CreateTable;
                command.ExecuteNonQuery();

                // Execute contracts
                ExecutionContracts.Execute(ec => ec.OnCreate(connection));
            }