Example #1
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Manta.Projections.MsSql.Benchmarks ({0}) without batching...", RuntimeInformation.FrameworkDescription);
            Console.WriteLine("{0} ({1})", RuntimeInformation.OSDescription, RuntimeInformation.OSArchitecture);
            Console.WriteLine("Starting...");

            Install().Wait();

            var projector = new MsSqlProjector("StaticUniqueProjectorName", connectionString, new JilSerializer())
                            .AddProjections(typeof(TestProjection).Assembly, t => t.Namespace.StartsWith("Manta.Projections.MsSql.Benchmarks.TestProjections"))
                            .AddLogger(new NullLogger())
                            .WithStatistics(s => Console.WriteLine(s.ToString()))
                            .OnProjectingError(
                x =>
            {
                Console.WriteLine($"Projecting error at position {x.Envelope.Meta.MessagePosition}[Retry: {x.Context.RetryAttempt}] with message: {x.InnerException.Message}.");
            });

            ExecuteOnce(projector).Wait();

            // ExecuteRunner(projector);

            Console.WriteLine("\r\nPress any key to exit...");
            Console.ReadKey();
        }
Example #2
0
        public async Task <Projector> GetProjector(Action <ProjectorBase> cfg)
        {
            if (!_databaseCreated)
            {
                await CreateDatabase().NotOnCapturedContext();
            }
            var projector = new MsSqlProjector("uniqueProjectorName", ConnectionString, new JilSerializer());

            cfg?.Invoke(projector);
            return(projector);
        }