<commit_before>﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace DebateAppDomainAPI.Models
{

    public class DBHelper
    {
        private HttpClient _client = new HttpClient();
        private string _api = "http://localhost:54625/api/";
        private string GetDebate = "Debates/";
        private string GetUser = "Accounts/";
        private string PostUser = "Accounts/";
        private string PostDebate = "Debates/";
        private string PutDebate = "Debates/";
        private string PutUser = "Accounts/";


        public DebateModel DBGetDebate(int? id)
        {
            var res = _client.GetAsync(_api + GetDebate + id).GetAwaiter().GetResult();
            var ResObject = res.Content.ReadAsStringAsync().GetAwaiter().GetResult();
            var result = JsonConvert.DeserializeObject<DebateModel>(ResObject);
            return result;
        }

        public IEnumerable<DebateModel> DBGetAllDebate()
        {
            var res = _client.GetAsync(_api + GetDebate).GetAwaiter().GetResult();
            var ResObject = res.Content.ReadAsStringAsync().GetAwaiter().GetResult();<commit_msg>forgot to change the api string back<commit_after>﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace DebateAppDomainAPI.Models
{

    public class DBHelper
    {
        private HttpClient _client = new HttpClient();
        private string _api = "http://ec2-18-221-110-13.us-east-2.compute.amazonaws.com/DBapi/api/";
        private string GetDebate = "Debates/";
        private string GetUser = "Accounts/";
        private string PostUser = "Accounts/";
        private string PostDebate = "Debates/";
        private string PutDebate = "Debates/";
        private string PutUser = "Accounts/";


        public DebateModel DBGetDebate(int? id)
        {
            var res = _client.GetAsync(_api + GetDebate + id).GetAwaiter().GetResult();
            var ResObject = res.Content.ReadAsStringAsync().GetAwaiter().GetResult();
            var result = JsonConvert.DeserializeObject<DebateModel>(ResObject);
            return result;
        }

        public IEnumerable<DebateModel> DBGetAllDebate()
        {
            var res = _client.GetAsync(_api + GetDebate).GetAwaiter().GetResult();
            var ResObject = res.Content.ReadAsStringAsync().GetAwaiter().GetResult();
{'fraction_non_alphanumeric': 0.10880626223091977, 'fraction_numerical': 0.006653620352250489, 'mean_word_length': 2.8493975903614457, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1081770', 'n_tokens_mistral': 756, 'n_tokens_neox': 719, 'n_words': 163}