| 38 | | public interface ITabelScript |
| 39 | | { |
| 40 | | IEnumerable<TabelScriptRegistration> RegisterFor { get; } |
| 41 | | Task<TabelScriptResult> ExecuteAsync(IServiceProvider serviceProvider, PathElement path, HubCommand command, TabelScriptWhen when, TabelScriptResult scriptResult); |
| 42 | | } |
| | 38 | public interface ITabelScript |
| | 39 | { |
| | 40 | IEnumerable<TabelScriptRegistration> RegisterFor { get; } |
| | 41 | Task<TabelScriptResult> ExecuteAsync(IServiceProvider serviceProvider, PathElement path, HubCommand command, TabelScriptWhen when, TabelScriptResult scriptResult); |
| | 42 | } |
| | 46 | |
| | 47 | Het is mogelijk om een tabelscript klasse te registreren voor meerdere events (combinatie van pad, actie en moment). Onderstaand een voorbeeld: |
| | 48 | |
| | 49 | {{{ |
| | 50 | #!csharp |
| | 51 | |
| | 52 | public IEnumerable<TabelScriptRegistration> RegisterFor => new List<TabelScriptRegistration> { |
| | 53 | new TabelScriptRegistration { Command = HubCommand.DELETE, When = TabelScriptWhen.BEFORE, Path = "patient/behandelingen/fin_trajecten" }, |
| | 54 | new TabelScriptRegistration { Command = HubCommand.DELETE, When = TabelScriptWhen.AFTER, Path = "patient/behandelingen/fin_trajecten" }, |
| | 55 | new TabelScriptRegistration { Command = HubCommand.UPDATE, When = TabelScriptWhen.AFTER, Path = "patient/behandelingen/fin_trajecten" } |
| | 56 | }; |
| | 57 | |
| | 58 | }}} |
| | 59 | |
| | 60 | Voor elk van bovenstaande events zal method {{{ ExecuteAsync }}} van de klasse worden uitgevoerd. |
| | 61 | |
| | 62 | |