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 { public ReceiveProtector(IReceiveDocumentService documents) { Documents = documents; } public IReceiveDocumentService Documents { get; } public async Task Invoke(EntityProtectionArgs args) { if (await Documents.Select(new PrimaryKeyArgs { Id = args.Entity.Id }) is not IReceiveDocument document) return; throw new NotImplementedException(); } }