diff --git a/Directory.Build.props b/Directory.Build.props index 0e96bab039..7f014d0aa6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 8.8.1 + 8.8.2 12.0 Jeremy D. Miller;Babu Annamalai;Jaedyn Tonee https://martendb.io/logo.png diff --git a/build/build.cs b/build/build.cs index deb53428a2..e103f221dc 100644 --- a/build/build.cs +++ b/build/build.cs @@ -212,7 +212,8 @@ class Build : NukeBuild .ProceedAfterFailure() .Executes(() => { - var codegenCommands = new[] { "codegen delete", "codegen write", "codegen test" }; + // It's actually important to do a codegen write a 2nd time to prevent a temporary bug + var codegenCommands = new[] { "codegen delete", "codegen write", "codegen test", "codegen write" }; foreach (var command in codegenCommands) { DotNetRun(s => s diff --git a/src/CommandLineRunner/ExtraStores.cs b/src/CommandLineRunner/ExtraStores.cs new file mode 100644 index 0000000000..4a77395e13 --- /dev/null +++ b/src/CommandLineRunner/ExtraStores.cs @@ -0,0 +1,21 @@ +using System; +using Marten; + +namespace CommandLineRunner; + +public interface IThingStore: IDocumentStore; + +public class Thing +{ + public Guid Id { get; set; } +} + +public class Thing2 +{ + public Guid Id { get; set; } +} + +public class Thing3 +{ + public Guid Id { get; set; } +} diff --git a/src/CommandLineRunner/Program.cs b/src/CommandLineRunner/Program.cs index feda69ace1..2112e0f25a 100644 --- a/src/CommandLineRunner/Program.cs +++ b/src/CommandLineRunner/Program.cs @@ -40,10 +40,18 @@ public static IHostBuilder CreateHostBuilder(string[] args) return Host.CreateDefaultBuilder(args) .ConfigureServices((hostContext, services) => { + services.AddMartenStore(opts => + { + opts.Connection(ConnectionSource.ConnectionString); + opts.RegisterDocumentType(); + opts.RegisterDocumentType(); + opts.RegisterDocumentType(); + opts.GeneratedCodeMode = TypeLoadMode.Static; + }); + services.AddMartenStore(opts => { opts.Connection(ConnectionSource.ConnectionString); - opts.RegisterDocumentType(); opts.GeneratedCodeMode = TypeLoadMode.Static; // If you use compiled queries, you will need to register the diff --git a/src/Marten/Internal/SecondaryStoreConfig.cs b/src/Marten/Internal/SecondaryStoreConfig.cs index 1e3454d7b7..dbeb3af038 100644 --- a/src/Marten/Internal/SecondaryStoreConfig.cs +++ b/src/Marten/Internal/SecondaryStoreConfig.cs @@ -59,7 +59,8 @@ public interface IConfigureMarten: IConfigureMarten where T : IDocumentStore { } -internal class SecondaryStoreConfig: ICodeFile, IStoreConfig where T : IDocumentStore + +internal class SecondaryStoreConfig: IStoreConfig where T : IDocumentStore { private readonly Func _configuration; private Type? _storeType; diff --git a/src/Marten/MartenServiceCollectionExtensions.cs b/src/Marten/MartenServiceCollectionExtensions.cs index d0c27c2932..b41c4637b1 100644 --- a/src/Marten/MartenServiceCollectionExtensions.cs +++ b/src/Marten/MartenServiceCollectionExtensions.cs @@ -324,6 +324,7 @@ public static MartenStoreExpression AddMartenStore(this IServiceCollection }); services.AddSingleton(s => config.BuildStoreOptions(s).EventGraph); + services.AddSingleton(s => config.BuildStoreOptions(s)); return new MartenStoreExpression(services); }