public ConstructorDefinition Parse <T>(Expression <Func <CustomConstructBuilder, T> > constructor) { if (constructor.Body is NewExpression newExpr) { return(ExpressionParserHelper.CreateConstructorGenerator(newExpr)); } throw new NotSupportedException(); }
public BotConfiguration Parse <T>(Expression <Func <BotConfigurationBuilder, T> > factory) { if (factory.Body is MemberInitExpression memberInitExpr) { return(ExpressionParserHelper.ParseMemberInit(memberInitExpr)); } if (factory.Body is NewExpression newExpr) { return(ExpressionParserHelper.ParseConstructor(newExpr)); } throw new NotSupportedException(); }