-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storage action compliance tests are all green for Marten!
- Loading branch information
1 parent
3e90adf
commit b7be46b
Showing
4 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Persistence/MartenTests/using_storage_return_types_and_entity_attributes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using IntegrationTests; | ||
using Marten; | ||
using Wolverine; | ||
using Wolverine.ComplianceTests; | ||
using Wolverine.Marten; | ||
|
||
namespace MartenTests; | ||
|
||
public class using_storage_return_types_and_entity_attributes : StorageActionCompliance | ||
{ | ||
protected override void configureWolverine(WolverineOptions opts) | ||
{ | ||
opts.Services.AddMarten(m => | ||
{ | ||
m.Connection(Servers.PostgresConnectionString); | ||
m.DatabaseSchemaName = "todos"; | ||
m.DisableNpgsqlLogging = true; | ||
}).IntegrateWithWolverine(); | ||
|
||
opts.Policies.AutoApplyTransactions(); | ||
} | ||
|
||
public override async Task<Todo?> Load(Guid id) | ||
{ | ||
var store = Host.DocumentStore(); | ||
await using var session = store.QuerySession(); | ||
return await session.LoadAsync<Todo>(id); | ||
} | ||
|
||
public override async Task Persist(Todo todo) | ||
{ | ||
var store = Host.DocumentStore(); | ||
await using var session = store.LightweightSession(); | ||
session.Store(todo); | ||
await session.SaveChangesAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters