You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varstore= DocumentStore.For("****");varsession= store.LightweightSession();varresult=await session.QueryAsync<int>("select count(*) from mt_doc_foo");
Console.WriteLine($"Count: {result.First()}");
This leads to the following stack trace:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Marten.Exceptions.MartenCommandException..ctor(NpgsqlCommand command, Exception innerException)
at Marten.Exceptions.MartenExceptionTransformer.<>c.<.cctor>b__1_2(NpgsqlException e)
at JasperFx.Core.Exceptions.ExceptionTransform`1.TryTransform(Exception original, Exception& transformed)
at JasperFx.Core.Exceptions.ExceptionTransformExtensions.TransformAndThrow(IEnumerable`1 transforms, Exception ex)
at JasperFx.Core.Exceptions.ExceptionTransforms.TransformAndThrow(Exception ex)
at Marten.Exceptions.MartenExceptionTransformer.WrapAndThrow(Exception exception)
at Marten.Linq.MartenLinqQueryProvider.ExecuteHandlerAsync[T](IQueryHandler`1 handler, CancellationToken token)
at Marten.Internal.Sessions.QuerySession.QueryAsync[T](String sql, CancellationToken token, Object[] parameters)
at Program.<Main>$(String[] args) in /Users/arild/dev/gamefraym/MartenDOTest/ConsoleApp1/Program.cs:line 34
at Program.<Main>(String[] args)
The text was updated successfully, but these errors were encountered:
The same happening when DB is inaccessible because of network problems etc. At first, I thought that something was wrong with my document schema. It turns out that docker with Postgres was not running.
Minimal repro:
This leads to the following stack trace:
The text was updated successfully, but these errors were encountered: