2022-12-08 14:42:23 +01:00

25 lines
720 B
C#

using Connected.Data.DataProtection;
using Connected.Data.EntityProtection;
using Connected.Logistics.Documents.Receive;
using Connected.Middleware;
using Connected.ServiceModel;
namespace Connected.Logistics.Documents.Protection;
internal sealed class ReceiveProtector : MiddlewareComponent, IEntityProtector<IReceiveDocument>
{
public ReceiveProtector(IReceiveDocumentService documents)
{
Documents = documents;
}
public IReceiveDocumentService Documents { get; }
public async Task Invoke(EntityProtectionArgs<IReceiveDocument> args)
{
if (await Documents.Select(new PrimaryKeyArgs<int> { Id = args.Entity.Id }) is not IReceiveDocument document)
return;
throw new NotImplementedException();
}
}