rename factories
This commit is contained in:
@@ -7,7 +7,7 @@ public class PrimaryWidgetProvider :
|
||||
IWidgetProvider
|
||||
{
|
||||
public void Create(IServiceCollection services) => services.AddConfiguration<PrimaryWidgetConfiguration>()
|
||||
.AddTransient<PrimaryWidgetViewModelFactory>()
|
||||
.AddTransient(provider => provider.GetRequiredService<PrimaryWidgetViewModelFactory>().Create())
|
||||
.AddTransient<WidgetComponentMappinglFactory>()
|
||||
.AddTransient(provider => provider.GetRequiredService<WidgetComponentMappinglFactory>().Create())
|
||||
.AddWidgetTemplate<PrimaryWidgetViewModel>();
|
||||
}
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public class PrimaryWidgetViewModelFactory :
|
||||
IViewModelFactory<PrimaryWidgetConfiguration, IEnumerable<IWidgetComponentViewModel>>
|
||||
public class WidgetComponentMappinglFactory :
|
||||
MappingFactory<PrimaryWidgetConfiguration, IEnumerable<IWidgetComponentViewModel>>
|
||||
{
|
||||
private readonly PrimaryWidgetConfiguration configuration;
|
||||
private readonly IServiceFactory service;
|
||||
|
||||
public PrimaryWidgetViewModelFactory(PrimaryWidgetConfiguration configuration,
|
||||
public WidgetComponentMappinglFactory(PrimaryWidgetConfiguration configuration,
|
||||
IServiceFactory service)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Hyperbar;
|
||||
|
||||
public interface IViewModelFactory<TFrom, TTo>
|
||||
{
|
||||
TTo Create();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Hyperbar;
|
||||
|
||||
public interface MappingFactory<TFrom, TTo>
|
||||
{
|
||||
TTo Create();
|
||||
}
|
||||
Reference in New Issue
Block a user