2021-11-19 13:31:54 +01:00
|
|
|
namespace zero.Core.Collections
|
2021-10-13 12:47:18 +02:00
|
|
|
{
|
2021-11-19 13:31:54 +01:00
|
|
|
public class CollectionContext<T> : CollectionContext, ICollectionContext<T> where T : ZeroIdEntity, new()
|
|
|
|
|
{
|
|
|
|
|
public IInterceptorRunner<T> Interceptors { get; private set; }
|
|
|
|
|
|
|
|
|
|
public CollectionContext(IZeroContext context, IInterceptorRunner<T> interceptors) : base(context)
|
|
|
|
|
{
|
|
|
|
|
Interceptors = interceptors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-10-13 12:47:18 +02:00
|
|
|
public class CollectionContext : ICollectionContext
|
|
|
|
|
{
|
|
|
|
|
public IZeroStore Store { get; private set; }
|
|
|
|
|
|
|
|
|
|
public IZeroContext Context { get; private set; }
|
|
|
|
|
|
|
|
|
|
public IZeroOptions Options { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
2021-11-19 13:31:54 +01:00
|
|
|
public CollectionContext(IZeroContext context)
|
2021-10-13 12:47:18 +02:00
|
|
|
{
|
2021-11-19 13:31:54 +01:00
|
|
|
Store = context.Store;
|
|
|
|
|
Options = context.Options;
|
2021-10-13 12:47:18 +02:00
|
|
|
Context = context;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-11-19 13:31:54 +01:00
|
|
|
public interface ICollectionContext<T> : ICollectionContext where T : ZeroIdEntity, new()
|
|
|
|
|
{
|
|
|
|
|
IInterceptorRunner<T> Interceptors { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-10-13 12:47:18 +02:00
|
|
|
public interface ICollectionContext
|
|
|
|
|
{
|
|
|
|
|
IZeroStore Store { get; }
|
|
|
|
|
|
|
|
|
|
IZeroContext Context { get; }
|
|
|
|
|
|
|
|
|
|
IZeroOptions Options { get; }
|
|
|
|
|
}
|
|
|
|
|
}
|