diff --git a/src/Umbraco.Core/Scoping/ScopeContext.cs b/src/Umbraco.Core/Scoping/ScopeContext.cs index 89697246c8..c79f02a0fa 100644 --- a/src/Umbraco.Core/Scoping/ScopeContext.cs +++ b/src/Umbraco.Core/Scoping/ScopeContext.cs @@ -74,12 +74,30 @@ namespace Umbraco.Core.Scoping } } - public void Enlist(string key, Action action, int priority = 100) + // todo: replace with optional parameters when we can break things + public T Enlist(string key, Func creator) + { + return Enlist(key, creator, null, 100); + } + + // todo: replace with optional parameters when we can break things + public T Enlist(string key, Func creator, Action action) + { + return Enlist(key, creator, action, 100); + } + + // todo: replace with optional parameters when we can break things + public void Enlist(string key, Action action) + { + Enlist(key, null, (completed, item) => action(completed), 100); + } + + public void Enlist(string key, Action action, int priority) { Enlist(key, null, (completed, item) => action(completed), priority); } - public T Enlist(string key, Func creator = null, Action action = null, int priority = 100) + public T Enlist(string key, Func creator, Action action, int priority) { if (_exiting) throw new InvalidOperationException("Cannot enlist now, context is exiting.");