IDocumentStore => IZeroStore

This commit is contained in:
2020-11-15 17:07:27 +01:00
parent 3943f92f4c
commit c4e91efd5b
33 changed files with 155 additions and 164 deletions
@@ -94,15 +94,6 @@ namespace zero.Core.Extensions
}
/// <summary>
/// Create a new unique Id
/// </summary>
public static string Id(this IDocumentStore store, int length = -1)
{
return IdGenerator.Create(length);
}
/// <summary>
/// Reserves a key cluster-wide
/// </summary>
+3 -3
View File
@@ -105,7 +105,7 @@ namespace zero.Core.Extensions
{
return ruleBuilder.MustAsync(async (entity, value, context, cancellation) =>
{
using IAsyncDocumentSession session = store.Raven.OpenAsyncSession();
using IAsyncDocumentSession session = store.Store.OpenAsyncSession();
bool any = await session.Advanced.AsyncDocumentQuery<T>()
.WhereNotEquals(nameof(IZeroIdEntity.Id), entity.Id)
@@ -124,7 +124,7 @@ namespace zero.Core.Extensions
{
return ruleBuilder.MustAsync(async (entity, value, context, cancellation) =>
{
using IAsyncDocumentSession session = store.Raven.OpenAsyncSession();
using IAsyncDocumentSession session = store.Store.OpenAsyncSession();
return await session.Advanced.AsyncDocumentQuery<T>()
.WhereNotEquals(nameof(IZeroIdEntity.Id), entity.Id)
@@ -155,7 +155,7 @@ namespace zero.Core.Extensions
return true;
}
using IAsyncDocumentSession session = store.Raven.OpenAsyncSession();
using IAsyncDocumentSession session = store.Store.OpenAsyncSession();
TReference model = await session.LoadAsync<TReference>(id);
return model != null;
}).WithMessage("@errors.forms.reference_notfound");