Fixed configuration to allow merge of new data into existing data
This commit is contained in:
@@ -22,7 +22,7 @@ public class Component :
|
||||
return factory.Create<TComponent>(builder);
|
||||
}
|
||||
|
||||
public IComponentBuilder Configure(string? name = null,
|
||||
public IComponentBuilder Configure(string name,
|
||||
Action<IComponentBuilder>? builderDelegate = null)
|
||||
{
|
||||
if (builderDelegate is not null)
|
||||
@@ -33,5 +33,29 @@ public class Component :
|
||||
return Configuring(builder);
|
||||
}
|
||||
|
||||
public IComponentBuilder Configure(Action<IComponentBuilder>? builderDelegate = null)
|
||||
{
|
||||
if (builderDelegate is not null)
|
||||
{
|
||||
builderDelegate(builder);
|
||||
}
|
||||
|
||||
return Configuring(builder);
|
||||
}
|
||||
|
||||
public IComponentBuilder Configure<TConfiguration>(string name,
|
||||
TConfiguration? configuration = null,
|
||||
Action<IComponentBuilder>? builderDelegate = null)
|
||||
where TConfiguration : class, new()
|
||||
{
|
||||
if (builderDelegate is not null)
|
||||
{
|
||||
builderDelegate(builder);
|
||||
}
|
||||
|
||||
builder.AddConfiguration(name, configuration);
|
||||
return Configuring(builder);
|
||||
}
|
||||
|
||||
public virtual IComponentBuilder Configuring(IComponentBuilder builder) => builder;
|
||||
}
|
||||
Reference in New Issue
Block a user