Refactor command handlers and Startup
This commit is contained in:
27
src/AppCommon/FileTime.App.Core/Startup.cs
Normal file
27
src/AppCommon/FileTime.App.Core/Startup.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using FileTime.App.Core.Services;
|
||||
using FileTime.App.Core.Services.CommandHandler;
|
||||
using FileTime.App.Core.ViewModels;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace FileTime.App.Core
|
||||
{
|
||||
public static class Startup
|
||||
{
|
||||
public static IServiceCollection AddCoreAppServices(this IServiceCollection serviceCollection)
|
||||
{
|
||||
return serviceCollection
|
||||
.AddTransient<ITabViewModel, TabViewModel>()
|
||||
.AddTransient<IContainerViewModel, ContainerViewModel>()
|
||||
.AddTransient<IElementViewModel, ElementViewModel>()
|
||||
.AddTransient<IItemNameConverterService, ItemNameConverterService>()
|
||||
.AddSingleton<ICommandHandlerService, CommandHandlerService>()
|
||||
.AddCommandHandlers();
|
||||
}
|
||||
|
||||
private static IServiceCollection AddCommandHandlers(this IServiceCollection serviceCollection)
|
||||
{
|
||||
return serviceCollection
|
||||
.AddSingleton<ICommandHandler, NavigationCommandHandler>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user