diff --git a/TelegramBotBase/Base/LambdaStartFormFactory.cs b/TelegramBotBase/Base/LambdaStartFormFactory.cs new file mode 100644 index 0000000..94bd502 --- /dev/null +++ b/TelegramBotBase/Base/LambdaStartFormFactory.cs @@ -0,0 +1,22 @@ +using TelegramBotBase.Form; +using TelegramBotBase.Interfaces; + +namespace TelegramBotBase.Base +{ + public class LambdaStartFormFactory : IStartFormFactory + { + public delegate FormBase CreateFormDelegate(); + + private readonly CreateFormDelegate _lambda; + + public LambdaStartFormFactory(CreateFormDelegate lambda) + { + _lambda = lambda; + } + + public FormBase CreateForm() + { + return _lambda(); + } + } +} \ No newline at end of file