16 lines
458 B
C#
16 lines
458 B
C#
using ExcelTableImporter.Models.ExcelModels;
|
|
|
|
namespace ExcelTableImporter.Commands;
|
|
|
|
public class CommandHandlerFactory(AnimeLibrary library)
|
|
{
|
|
public ICommandHandler? GetHandler(ICommand command)
|
|
{
|
|
return command switch
|
|
{
|
|
ExitCommand exitCommand => new ExitCommandHandler(library, exitCommand),
|
|
ListCommand listCommand => new ListCommandHandler(library, listCommand),
|
|
_ => null
|
|
};
|
|
}
|
|
} |