Skip to content

Commit e1b0a0c

Browse files
committed
convenience method on ScriptServicesBuilder
so that I don't have to break out of the flow
1 parent 5ea8f46 commit e1b0a0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ScriptCs.Hosting/ScriptServicesBuilder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System;
22
using System.Linq;
3+
using System.Collections.Generic;
34
using ScriptCs.Contracts;
45
using ScriptCs.Logging;
56
using LogLevel = ScriptCs.Contracts.LogLevel;
67

78
namespace ScriptCs.Hosting
89
{
10+
911
public class ScriptServicesBuilder : ServiceOverrides<IScriptServicesBuilder>, IScriptServicesBuilder
1012
{
1113
private readonly ITypeResolver _typeResolver;
@@ -131,6 +133,12 @@ public IScriptServicesBuilder Debug(bool debug = true)
131133
return this;
132134
}
133135

136+
public IScriptServicesBuilder SetOverrides(Action<IDictionary<Type, object>> applyOverrides)
137+
{
138+
applyOverrides(Overrides);
139+
return this;
140+
}
141+
134142
public IInitializationServices InitializationServices { get; private set; }
135143

136144
public IConsole ConsoleInstance { get; private set; }

0 commit comments

Comments
 (0)