public Kontrol BegeniGeriAl([FromBody] BegeniGeriAlIstek b)
        {
            Kontrol Control = new Kontrol();

            try
            {
                using (db = new oylesineEntities())
                {
                    Begeniler begeni = new Begeniler();
                    begeni = db.Begenilers.Find(b.begeniID);
                    db.Begenilers.Remove(begeni);
                    db.SaveChanges();
                    Control.basari = true;
                }
            }
            catch
            {
                Control.basari = false;
            }
            return(Control);
        }
        public BaseResponse Begen(BegenRequest begenRequest)
        {
            BaseResponse baseResponse = new BaseResponse();
            Begeniler    begeniler    = _begenilerRepository.Find(x => x.KullaniciAdi == begenRequest.KullaniciAdi && x.Slug == begenRequest.Slug);

            if (begeniler != null)
            {
                baseResponse.durum = false;
                baseResponse.mesaj = "Bu Paylaşım Zaten Beğenildi..";
            }
            else
            {
                Begeniler begeniler1 = new Begeniler();
                begeniler1.KullaniciAdi = begenRequest.KullaniciAdi;
                begeniler1.Slug         = begenRequest.Slug;
                _begenilerRepository.Insert(begeniler1);
                baseResponse.durum = true;
                baseResponse.mesaj = "Paylaşım Beğenildi.";
                int sayi = _begenilerRepository.List(x => x.Slug == begenRequest.Slug).Count();
                if (sayi % 2 == 0)
                {
                    #region Post Transaction

                    List <Transactions> transactions = new List <Transactions>()
                    {
                        new Transactions()
                        {
                            sender   = "Sistem",
                            receiver = "Beğeniler",
                            amount   = 0.0500f
                        }
                    };
                    HttpClient client = new HttpClient();
                    client.BaseAddress = new Uri("http://127.0.0.1:5000/");
                    HttpResponseMessage responseMessage = client.PostAsJsonAsync("add_transaction", transactions[0]).Result;
                    var emp1 = responseMessage.Content.ReadAsAsync <AddTransactionResponse>().Result;

                    #endregion
                    #region Json Listeleme ve Temizleme
                    StreamReader        rr      = new StreamReader("D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\transactions.json");
                    string              json2   = rr.ReadToEnd();
                    dynamic             array   = JsonConvert.DeserializeObject(json2);
                    List <Transactions> sorular = JsonConvert.DeserializeObject <List <Transactions> >(json2);
                    rr.Close();
                    System.IO.File.WriteAllText("D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\transactions.json", string.Empty);


                    #endregion
                    #region Eski Liste İle Tekrar Listeye Dökme

                    if (sorular != null)
                    {
                        transactions.AddRange(sorular);
                    }

                    string       dosya_yolu1 = @"D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\transactions.json";
                    StreamWriter sw1         = File.AppendText(dosya_yolu1);
                    string       json1       = JsonConvert.SerializeObject(transactions);
                    sw1.WriteLine(json1);
                    sw1.Flush();
                    sw1.Close();
                    #endregion
                    #region Zinciri Bitirme(mine_block)
                    if (sorular == null)
                    {
                    }
                    else
                    {
                        if (sorular.Count >= 10)
                        {
                            HttpClient client1 = new HttpClient();
                            client1.BaseAddress = new Uri("http://127.0.0.1:5000/");
                            HttpResponseMessage responseMessage1 = client1.GetAsync("mine_block").Result;
                            responseMessage1.EnsureSuccessStatusCode();
                            //    var responseBody = responseMessage1.Content.ReadAsStringAsync();
                            //    var emp = responseMessage1.Content.ReadAsAsync<GenelChainList>().Result;
                            System.IO.File.WriteAllText("D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\transactions.json", string.Empty);
                            HttpClient client2 = new HttpClient();
                            client2.BaseAddress = new Uri("http://127.0.0.1:5000/");
                            HttpResponseMessage responseMessage2 = client2.GetAsync("get_chain").Result;
                            responseMessage2.EnsureSuccessStatusCode();
                            var            responseBody = responseMessage2.Content.ReadAsStringAsync();
                            GenelChainList emp          = responseMessage2.Content.ReadAsAsync <GenelChainList>().Result;



                            System.IO.File.WriteAllText("D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\chain.json", string.Empty);



                            string       dosya_yolu2 = @"D:\\Programlama\\C#_Uygulamalari\\PROJELERİM\\Bitirme\\Bitirme\\Bitirme\\Bitirme\\Dosyalar\\chain.json";
                            StreamWriter sw2         = File.AppendText(dosya_yolu2);
                            string       json3       = JsonConvert.SerializeObject(emp);
                            sw2.WriteLine(json3);
                            sw2.Flush();
                            sw2.Close();
                        }
                    }

                    #endregion
                }
            }
            return(baseResponse);
        }