Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>8.8.1</Version>
<Version>8.8.2</Version>
<LangVersion>12.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Jaedyn Tonee</Authors>
<PackageIconUrl>https://martendb.io/logo.png</PackageIconUrl>
Expand Down
3 changes: 2 additions & 1 deletion build/build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions src/CommandLineRunner/ExtraStores.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
10 changes: 9 additions & 1 deletion src/CommandLineRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ public static IHostBuilder CreateHostBuilder(string[] args)
return Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
services.AddMartenStore<IThingStore>(opts =>
{
opts.Connection(ConnectionSource.ConnectionString);
opts.RegisterDocumentType<Thing>();
opts.RegisterDocumentType<Thing2>();
opts.RegisterDocumentType<Thing3>();
opts.GeneratedCodeMode = TypeLoadMode.Static;
});

services.AddMartenStore<IOtherStore>(opts =>
{
opts.Connection(ConnectionSource.ConnectionString);
opts.RegisterDocumentType<Target>();
opts.GeneratedCodeMode = TypeLoadMode.Static;

// If you use compiled queries, you will need to register the
Expand Down
3 changes: 2 additions & 1 deletion src/Marten/Internal/SecondaryStoreConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public interface IConfigureMarten<T>: IConfigureMarten where T : IDocumentStore
{
}

internal class SecondaryStoreConfig<T>: ICodeFile, IStoreConfig where T : IDocumentStore

internal class SecondaryStoreConfig<T>: IStoreConfig where T : IDocumentStore
{
private readonly Func<IServiceProvider, StoreOptions> _configuration;
private Type? _storeType;
Expand Down
1 change: 1 addition & 0 deletions src/Marten/MartenServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ public static MartenStoreExpression<T> AddMartenStore<T>(this IServiceCollection
});

services.AddSingleton<ICodeFileCollection>(s => config.BuildStoreOptions(s).EventGraph);
services.AddSingleton<ICodeFileCollection>(s => config.BuildStoreOptions(s));

return new MartenStoreExpression<T>(services);
}
Expand Down
Loading