﻿
{"id":752,"date":"2012-05-28T13:47:01","date_gmt":"2012-05-28T13:47:01","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=752"},"modified":"2012-05-28T18:36:04","modified_gmt":"2012-05-28T18:36:04","slug":"rastgele-sirali-list-koleksiyonu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/rastgele-sirali-list-koleksiyonu\/","title":{"rendered":"Rastgele S\u0131ral\u0131 List Koleksiyonu"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Varsayal\u0131m ki, elimizde List tipinden bir koleksiyon olsun.\u0130\u00e7inde de nesneler olsun.Her seferinde farkl\u0131 farkl\u0131 s\u0131ralanm\u0131\u015f bi\u00e7imde getirmek istiyorsak e\u011fer a\u015fa\u011f\u0131daki y\u00f6netmi uygulayabilirsiniz.<br \/>\n<!--more--><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n        class Ogrenci\r\n        {\r\n            public int OgrenciNo { get; set; }\r\n            public string OgrenciAdi { get; set; }\r\n            public string OgrenciSoyadi { get; set; }\r\n            public string Ogretmeni { get; set; }\r\n        }\r\n\r\n        private void Form1_Load(object sender, EventArgs e)\r\n        {\r\n            Ogrenci o1 = new Ogrenci { OgrenciNo = 1, OgrenciAdi = &quot;Gen\u00e7ay&quot;, OgrenciSoyadi = &quot;Y\u0131ld\u0131z&quot;, Ogretmeni = &quot;Engin&quot; };\r\n            Ogrenci o2 = new Ogrenci { OgrenciNo = 2, OgrenciAdi = &quot;G\u00fcl\u015fah&quot;, OgrenciSoyadi = &quot;Y\u0131ld\u0131z&quot;, Ogretmeni = &quot;Ceylan&quot; };\r\n            Ogrenci o3 = new Ogrenci { OgrenciNo = 3, OgrenciAdi = &quot;Emine&quot;, OgrenciSoyadi = &quot;Y\u0131ld\u0131z&quot;, Ogretmeni = &quot;Ay\u015fe&quot; };\r\n            Ogrenci o4 = new Ogrenci { OgrenciNo = 4, OgrenciAdi = &quot;Gizem&quot;, OgrenciSoyadi = &quot;I\u015f\u0131k&quot;, Ogretmeni = &quot;Fatma&quot; };\r\n            Ogrenci o5 = new Ogrenci { OgrenciNo = 5, OgrenciAdi = &quot;Leyla&quot;, OgrenciSoyadi = &quot;Asl\u0131bay&quot;, Ogretmeni = &quot;Emrah&quot; };\r\n            List&lt;Ogrenci&gt; Ogrenciler = new List&lt;Ogrenci&gt;();\r\n            Ogrenciler.Add(o1);\r\n            Ogrenciler.Add(o2);\r\n            Ogrenciler.Add(o3);\r\n            Ogrenciler.Add(o4);\r\n            Ogrenciler.Add(o5);\r\n\r\n            var Sonuc = Ogrenciler.OrderBy(p =&gt; Guid.NewGuid());\r\n\r\n            for (int i = 0; i &lt; 3; i++)\r\n            {\r\n                string Sirali = &quot;&quot;;\r\n                foreach (var item in Sonuc)\r\n                {\r\n                    Sirali += item.OgrenciNo + &quot; &quot; + item.OgrenciAdi + Environment.NewLine;\r\n                }\r\n                MessageBox.Show(Sirali);\r\n            }\r\n        }\r\n<\/pre>\n<table style=\"width: 100%;\">\n<tbody>\n<tr>\n<td>\u00a0<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/11.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-753\" title=\"1\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/11.jpg\" alt=\"\" width=\"116\" height=\"141\" \/><\/a><\/td>\n<td>\u00a0<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/21.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-754\" title=\"2\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/21.jpg\" alt=\"\" width=\"114\" height=\"145\" \/><\/a><\/td>\n<td>\u00a0<a href=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-755\" title=\"3\" src=\"http:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2012\/05\/3.jpg\" alt=\"\" width=\"117\" height=\"142\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>G\u00f6rd\u00fc\u011f\u00fcn\u00fcz gibi List koleksiyonumuzdaki nesnelere rastgele s\u0131ral\u0131 ula\u015fabiliyoruz.<\/p>\n<p>\u0130yi \u00e7al\u0131\u015fmalar \ud83d\ude42<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Varsayal\u0131m ki, elimizde List tipinden bir koleksiyon olsun.\u0130\u00e7inde de nesneler olsun.Her seferinde farkl\u0131 farkl\u0131 s\u0131ralanm\u0131\u015f bi\u00e7imde getirmek istiyorsak e\u011fer a\u015fa\u011f\u0131daki y\u00f6netmi uygulayabilirsiniz.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,12,226],"tags":[232],"class_list":["post-752","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-c-sharp-c","category-linq","tag-extension"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=752"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/752\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}