Beispiel #1
0
        public override async Task <ScenarioResult> OnMessage(MessageEventArgs args)
        {
            var dbFeedback = new DBFeedback(args.Message.Text);
            await Repository.AddFeedback(args.Message.ForwardFrom, dbFeedback);

            await PrintMenu("Ваше сообщение отправлено разработчикам, можете написать ещё что-нибудь:");

            return(ScenarioResult.ContinueCurrent);
        }
Beispiel #2
0
        public async Task <DBFeedback> AddFeedback(User user, DBFeedback feedback)
        {
            using var connection = await CreateAndOpenConnection();

            var userID = await AddOrUpdateUserCore(connection, user);

            feedback.User = userID;

            return(await AddFeedbackCore(connection, feedback));
        }
Beispiel #3
0
        async Task <DBFeedback> AddFeedbackCore(NpgsqlConnection conection, DBFeedback feedback)
        => await conection.QuerySingleAsync <DBFeedback>(
            @"insert into reviews(user, feedback)
values (@User, @Feedback)
returning
    id as ID,
    create_time as CreateTime,
    user as User,
    feedback as Feedback",
            feedback);
Beispiel #4
0
        public async Task <DBFeedback> AddFeedback(DBFeedback feedback)
        {
            using var connection = await CreateAndOpenConnection();

            return(await AddFeedbackCore(connection, feedback));
        }