using System; using System.Collections.Generic; using System.Threading.Tasks; using zero.Core.Entities; namespace zero.Core.Collections { public class InterceptorHelper { protected ICollectionInterceptorHandler Handler { get; set; } public InterceptorHelper(ICollectionInterceptorHandler handler) { Handler = handler; } public async Task.UpdateParameters>> Updating(T model) where T : ZeroEntity { CollectionInterceptor.UpdateParameters parameters = new(); InterceptorInstruction.UpdateParameters> instruction = Handler.Create.UpdateParameters>("update", parameters) ?? new(); await instruction.HandleBefore(x => x.Updating(instruction.Parameters)); return instruction; } } }