diff --git a/TelegramBotBase/Factories/LambdaStartFormFactory.cs b/TelegramBotBase/Factories/LambdaStartFormFactory.cs new file mode 100644 index 0000000..c748b20 --- /dev/null +++ b/TelegramBotBase/Factories/LambdaStartFormFactory.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; +using TelegramBotBase.Form; + +namespace TelegramBotBase.Factories +{ + public class LambdaStartFormFactory : Interfaces.IStartFormFactory + { + public delegate FormBase CreateFormDelegate(); + + private readonly CreateFormDelegate _lambda; + + public LambdaStartFormFactory(CreateFormDelegate lambda) + { + _lambda = lambda; + } + + public FormBase CreateForm() + { + return _lambda(); + } + } +}