using Connected.Data.EntityProtection; using Connected.Middleware; namespace Connected.Data.DataProtection; internal class EntityProtectionService : IEntityProtectionService { public EntityProtectionService(IMiddlewareService middleware) { Middleware = middleware; } public IMiddlewareService Middleware { get; } public async Task Invoke(EntityProtectionArgs args) { var middleware = await Middleware.Query>(); if (!middleware.Any()) return; foreach (var m in middleware) await m.Invoke(args); } }