﻿
{"id":12675,"date":"2019-12-14T02:59:29","date_gmt":"2019-12-14T02:59:29","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=12675"},"modified":"2019-12-14T02:59:29","modified_gmt":"2019-12-14T02:59:29","slug":"c-8-0-nullable-reference-types","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/c-8-0-nullable-reference-types\/","title":{"rendered":"C# 8.0 &#8211; Nullable Reference Types"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>D\u00fcn d\u00fcnde kald\u0131, yar\u0131nlar ise \u015fekilleniyorken biz \u015fimdinin s\u0131n\u0131rlar\u0131 i\u00e7erisinde asl\u0131nda sade ve sadece basit ve tek kare bir an\u0131 ya\u015f\u0131yoruz \u015fu fani d\u00fcnyada. Her \u015fey de\u011fi\u015fiyor. Bu de\u011fi\u015fimden en b\u00fcy\u00fck at\u0131l\u0131mlar\u0131 geli\u015febilenler sa\u011fl\u0131yor, di\u011ferleri ise ya nasibini bekliyor yahut r\u00fczgarda savrulan yaprak misali beyhude s\u00fcreci seyr ediyor&#8230; Sanat, m\u00fczik, fizik vs. t\u00fcm\u00fc bu g\u00fcn d\u00fcne nazaran fark\u0131n\u0131 ortaya koyuyor ve yar\u0131n daha da iyi olabilmek i\u00e7in de\u011fi\u015fiyor, geli\u015fiyor. Biz bu pencereden yaz\u0131l\u0131m d\u00fcnyas\u0131na bakarsak e\u011fer d\u00fcne kadar sineye \u00e7ekilen b\u00fcy\u00fck bir gedi\u011fi yar\u0131nlar\u0131n ehemmiyeti ve bu de\u011fi\u015fim girdab\u0131ndaki en verimli geli\u015fimsel devrimi sa\u011flayabilmek i\u00e7in cesur bir ad\u0131mla ortadan kald\u0131rmaya \u00e7al\u0131\u015fan yeni bir \u00f6zellik geli\u015ftiriliyor. C# 8.0 Nullable Reference Types \u00f6zelli\u011fi&#8230;<\/p>\n<p>Her zaman vurgulad\u0131\u011f\u0131m gibi, gelen her bir yenilik esas\u0131nda olmayan\u0131 oldurmas\u0131 i\u00e7in de\u011fil, olmas\u0131 gerekti\u011fi i\u00e7indir. .NET geli\u015ftiricileri bu g\u00fcne kadar referans t\u00fcrl\u00fc de\u011fi\u015fkenler i\u00e7in null de\u011ferinin kar\u015f\u0131lanabilir olmas\u0131ndan dolay\u0131 tip g\u00fcvenli\u011finde yarat\u0131lan anlams\u0131z bo\u015flu\u011fu ve l\u00fczumsuz koda sebebiyet verilmesi durumunu C# 8.0 ile gelen en radikal ve b\u00fcy\u00fck \u00f6zelli\u011fi olan Nullable Reference Types sayesinde kontrol alt\u0131na almaya karar vermi\u015ftir.<\/p>\n<p><strong>Peki bu \u00f6zellik hangi sorunu ortadan kald\u0131rmaya gelmi\u015ftir?<\/strong><br \/>\nOOP temelli bir\u00e7ok programlama dilinde(<span style=\"font-size:14px;\">Keza C# d\u0131\u015f\u0131ndakilerden %100 emin de\u011filim \ud83d\ude42<\/span>) referans t\u00fcrl\u00fc tan\u0131mlanan t\u00fcm de\u011fi\u015fkenler &#8216;NULL&#8217; ile i\u015faretlenebilmektedirler. Bu \u00f6zellik tan\u0131mlanabilirlik a\u00e7\u0131s\u0131ndan do\u011fas\u0131 gere\u011fi bir fiiliyat\u0131 simgeleyen <em>-nullanabilirlik<\/em> yahut <em>-null&#8217;lamak<\/em> gibisinden halk dilinde geli\u015ftirilen bir jargon ile ifade edilmektedir diyebiliriz. Yap\u0131sal olarak geli\u015ftirilen uygulamalarda <em>-null&#8217;lanm\u0131\u015f<\/em> bir referans\u0131 kullanmada \u00f6nce null kontrol\u00fc yapma zarureti do\u011furan bu durum modern kodlama standarlar\u0131na pekte \u00e7a\u011fda\u015f olmayan bir yakla\u015f\u0131m sergilememizi gerektirmektedir.<\/p>\n<p>D\u00fc\u015f\u00fcnsenize;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            void Do(bool state)\r\n            {\r\n                string key = state ? &quot;abc&quot; : null;\r\n                if (key != null)\r\n                    Console.WriteLine(key);\r\n            }\r\n<\/pre>\n<p>\u015feklinde yaz\u0131lan bir kodu ele alal\u0131m. Sizce 4. sat\u0131rda yap\u0131lan kontrol ne kadar do\u011fald\u0131r? Bu alenen redundancy(gere\u011finden fazla) bir  sat\u0131r de\u011fil midir? Evet, bu g\u00fcne kadar bu kod olmas\u0131 gereken ve b\u00f6ylece zoraki de olsa do\u011fal olmak mecburiyetinde olan bir kontrold\u00fc. Lakin C# geli\u015ftiricileri, 8.0 versiyonunda gelen nullable reference types \u00f6zelli\u011fi ile referans t\u00fcrl\u00fc de\u011fi\u015fken dahi olsa &#8220;NULL&#8221; olabilecek referanslar\u0131 \u00f6nceden tan\u0131mlamam\u0131z\u0131 sa\u011flayarak buradaki kodun elzemli\u011fini daha da kontrol edilebilir bir hale getirmi\u015f bulunmaktad\u0131rlar. Bu \u00f6zellik sayesinde &#8220;NULL&#8221; almayacak bir de\u011fi\u015fkenin &#8220;NULL&#8221; almas\u0131 durumu s\u00f6z konusu oldu\u011fu taktirde ilgili developer compiler taraf\u0131ndan uyar\u0131lmakta ve b\u00f6ylece hem l\u00fczumsuz kodlardan ve ko\u015fullardan kodumuzu ar\u0131nd\u0131rm\u0131\u015f hemde null durumlar\u0131n\u0131n ortaya \u00e7\u0131karabilece\u011fi handikaplar dolayl\u0131da olsa engellenmi\u015f olmaktad\u0131r. <\/p>\n<p><strong>null durumlar\u0131n\u0131n ortaya \u00e7\u0131karabildi\u011fi handikaplar neler olabilir?<\/strong><br \/>\nBurada kastedilen genel olarak; Java prog. dilinde &#8220;<em>null pointer exception<\/em>&#8221; \u015feklinde ge\u00e7en ve C#&#8217;ta &#8220;<em>object reference not set to an instance of an object<\/em>&#8221; \u015feklinde kar\u015f\u0131l\u0131\u011f\u0131 olan ve genel olarak &#8220;<em>null reference exception<\/em>&#8221; diye bilinen hatalard\u0131r. null referans objelerin s\u00f6z konusu oldu\u011fu durumlarda al\u0131nan bu hatalara istinaden bilgisayar biliminin kurucular\u0131ndan <a href=\"https:\/\/www.google.com\/search?q=tony+hoare&#038;sxsrf=ACYBGNRJ20xU2x_heozaUguSRjLsbBgKcQ:1575841475700&#038;source=lnms&#038;sa=X&#038;ved=0ahUKEwi2jIb7gqfmAhUC_aQKHfXtCC4Q_AUIDSgA&#038;biw=1857&#038;bih=928&#038;dpr=1\" rel=\"noopener noreferrer\" target=\"_blank\">Tony Hoare<\/a> <span style=\"color:red\">-billion dollar mistake-<\/span> tabirini kullanmaktad\u0131r. \u00dcstat, \u00f6zellikle belirtilmedi\u011fi s\u00fcrece hi\u00e7bir referans\u0131n nullable olmamas\u0131 gerekti\u011fini vurgulamakta ve aksi taktirde al\u0131nan hatalardan dolay\u0131 ortaya \u00e7\u0131kan maliyetin d\u00fcnya ekonomisine bilan\u00e7osu milyar dolar olarak yans\u0131d\u0131\u011f\u0131n\u0131 ifade etmektedir. Keza onlarca kurumsal yahut bireysel projede \u015fahit oldu\u011fum \u00fczere ve piyasada en \u00e7ok \u015fikayet edilen hatalar olmas\u0131 hasebiyle null durumlar\u0131yla ili\u015fkili exception hatalar\u0131na dair tecr\u00fcbeme dayanaraktan \u00fcstad\u0131n bu yorumunu olduk\u00e7a hakl\u0131 buluyor ve nacizane olarak kat\u0131ld\u0131\u011f\u0131m\u0131 ifade etmek istiyorum.<\/p>\n<h2>Nullable Reference Types<\/h2>\n<h3>\u00d6n Haz\u0131rl\u0131klar<\/h3>\n<p>Bir uygulamada Nullable Reference Types \u00f6zelli\u011fini kullanabilmek i\u00e7in \u00f6ncelikle ilgili projede C# 8.0&#8217;\u0131n kullan\u0131ld\u0131\u011f\u0131ndan emin olunmas\u0131 gerekmektedir. Bunun i\u00e7in ilgili projeye Solution Explorer penceresinden sa\u011f t\u0131klayarak &#8220;Edit Project File&#8221; sekmesine gelerek a\u00e7\u0131lan sayfaya <code>&lt;LangVersion&gt;8.0&lt;\/LangVersion&gt;<\/code> kodunun yerle\u015ftirilmesi gerekmektedir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;\r\n  &lt;PropertyGroup&gt;\r\n    &lt;OutputType&gt;Exe&lt;\/OutputType&gt;\r\n    &lt;TargetFramework&gt;netcoreapp3.1&lt;\/TargetFramework&gt;\r\n    &lt;LangVersion&gt;8.0&lt;\/LangVersion&gt;\r\n  &lt;\/PropertyGroup&gt;\r\n&lt;\/Project&gt;\r\n<\/pre>\n<p>Bu i\u015flemin ard\u0131ndan ya uygulama\/proje seviyesinde yahut dosya seviyesinde Nullable Reference Types \u00f6zelli\u011fini etkinle\u015ftirebiliriz.<\/p>\n<ul>\n<li>\n<strong>Proje d\u00fczeyinde etkinle\u015ftirmek i\u00e7in;<\/strong><br \/>\nYine ayn\u0131 sayfaya a\u015fa\u011f\u0131daki gibi <code>&lt;Nullable&gt;enable&lt;\/Nullable&gt;<\/code> komutunun eklenmesi yeterlidir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;Project Sdk=&quot;Microsoft.NET.Sdk&quot;&gt;\r\n  &lt;PropertyGroup&gt;\r\n    &lt;OutputType&gt;Exe&lt;\/OutputType&gt;\r\n    &lt;TargetFramework&gt;netcoreapp3.1&lt;\/TargetFramework&gt;\r\n    &lt;LangVersion&gt;8.0&lt;\/LangVersion&gt;\r\n    &lt;Nullable&gt;enable&lt;\/Nullable&gt;\r\n  &lt;\/PropertyGroup&gt;\r\n&lt;\/Project&gt;\r\n<\/pre>\n<\/li>\n<li>\n<strong>Dosya d\u00fczeyinde etkinle\u015ftirmek i\u00e7in;<\/strong><br \/>\nNullable reference types \u00f6zelli\u011finin kullan\u0131laca\u011f\u0131 dosyada <code>#nullable enable<\/code> komutunun yaz\u0131lmas\u0131 yeterlidir. E\u011fer ki, ilgili \u00f6zelli\u011fin pasifle\u015ftirilip tekrar aktifle\u015ftirilmesini istiyorsak a\u015fa\u011f\u0131daki gibi kullan\u0131labilir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    class Program\r\n    {\r\n#nullable enable\r\n        static void Main(string&#x5B;] args)\r\n        {\r\n            \/\/Active\r\n        }\r\n#nullable disable\r\n        static void Metot2()\r\n        {\r\n            \/\/Passive\r\n        }\r\n#nullable enable\r\n        static void Metot3()\r\n        {\r\n            \/\/Active\r\n        }\r\n    }\r\n<\/pre>\n<p>G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere bu opsiyonalite olduk\u00e7a faydal\u0131 bir niteliktedir.\n<\/li>\n<\/ul>\n<h3>Temel \u00d6rnekler<\/h3>\n<p>Nullable Reference Types \u00f6zelli\u011finin aktif olarak kullan\u0131ld\u0131\u011f\u0131 bir projede art\u0131k referans t\u00fcrl\u00fc de\u011fi\u015fkenler varsay\u0131lan olarak null de\u011fer alamamaktad\u0131rlar. Bunun i\u00e7in ilgili referansa, <strong>?<\/strong> operat\u00f6r\u00fc ile i\u015faretleyerek nullable \u00f6zelli\u011finin kazand\u0131r\u0131lmas\u0131 gerekmektedir.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            MyClass m1 = null; \/\/Converting null literal or possible null value to non - nullable type.\r\n            MyClass? m2 = null; \/\/Ok\r\n            string s1 = null; \/\/Converting null literal or possible null value to non - nullable type.\r\n            string? s2 = null; \/\/Ok\r\n<\/pre>\n<p>G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere &#8220;m1&#8221; ve &#8220;s1&#8221; referanslar\u0131 null de\u011fer ald\u0131\u011f\u0131 taktirde compiler uyarmakta lakin &#8220;m2&#8221; ve &#8220;s2&#8221; referanslar\u0131nda herhangi bir uyar\u0131 s\u00f6z konusu olmamaktad\u0131r. Farkl\u0131 bir perspektiften durumu de\u011ferlendirebilmek kayd\u0131yla a\u015fa\u011f\u0131daki metotlar\u0131da inceleyebilirsiniz;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n    class Program\r\n    {\r\n        static void Main(string&#x5B;] args)\r\n        {\r\n            CannotBeNull(null); \/\/Cannot convert null literal to non - nullable reference type.\r\n\r\n            string? s1 = null;\r\n            CannotBeNull(s1); \/\/Possible null reference argument for parameter 'value' in ...\r\n\r\n            string? s2 = &quot;test&quot;;\r\n            CannotBeNull(s2); \/\/Ok\r\n\r\n            string s3 = &quot;test&quot;;\r\n            CannotBeNull(s3); \/\/Ok\r\n\r\n            MayBeNull(null); \/\/Ok\r\n\r\n            string? s4 = null;\r\n            MayBeNull(s4); \/\/Ok\r\n\r\n            string? s5 = &quot;test&quot;;\r\n            MayBeNull(s5); \/\/Ok\r\n\r\n            string s6 = &quot;test&quot;;\r\n            MayBeNull(s6); \/\/Ok\r\n\r\n        }\r\n\r\n        static void CannotBeNull(string value) =&gt; _ = value.Length; \/\/Ok\r\n        static void MayBeNull(string? value) =&gt; _ = value.Length; \/\/Dereference of a possibly null reference\r\n    }\r\n<\/pre>\n<blockquote style=\"color:green;\"><p><em><strong>Nullable Reference Types hatalar\u0131 sadece developer\u0131 bilgilendirmek ve yazd\u0131\u011f\u0131 koda uygun kontrat\u0131 hat\u0131rlatmak i\u00e7indir. Lakin derleme hatalar\u0131na girmedikleri i\u00e7in olas\u0131 NullReferenceException hatalar\u0131ndan ar\u0131nd\u0131r\u0131lm\u0131\u015f de\u011fildir.<\/strong><\/em><\/p><\/blockquote>\n<h3>Nullable \u00d6zellikte Olup Null Olmayan De\u011ferleri Garantiye Almak<\/h3>\n<h4>Null-Forgiving Operator(Null Affedici Operat\u00f6r\u00fc) &#8211; !<\/h4>\n<p>Bazen nullable \u00f6zellikte olup de\u011feri null olmayan de\u011fi\u015fkenlerimiz olabilir. \u0130\u015fte bu de\u011fi\u015fkenler \u00fczerinde \u00e7al\u0131\u015f\u0131rken nas\u0131l ki bizler null olmad\u0131\u011f\u0131na eminsek compiler\u0131nda bundan emin olmas\u0131n\u0131 sa\u011flayabilir ve hata vermesini engelleyebiliriz. Nihayetinde compiler bu durumu anlayabilmek i\u00e7in yeterince ak\u0131ll\u0131 olmad\u0131\u011f\u0131ndan dolay\u0131 bu i\u015flemi bir operasyonel ba\u011flam ile ele almak zorunday\u0131z. \u0130\u015fte bunun i\u00e7in null-forgiving(!) operat\u00f6r\u00fcn\u00fc kullanaca\u011f\u0131z.<\/p>\n<table>\n<thead>\n<tr>\n<th>Null-Forgiving Kullanmazken<\/th>\n<th>Null-Forgiving Kullan\u0131rken<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"519\" height=\"256\" class=\"aligncenter size-full wp-image-12739\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types.png 519w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-300x148.png 300w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-1.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"518\" height=\"202\" class=\"aligncenter size-full wp-image-12740\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-1.png 518w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-1-300x117.png 300w\" sizes=\"auto, (max-width: 518px) 100vw, 518px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\nYukar\u0131da mukayesesi yap\u0131lan ekran g\u00f6r\u00fcnt\u00fclerine g\u00f6z atarsan\u0131z e\u011fer &#8220;GetValue&#8221; isimli metot ald\u0131\u011f\u0131 parametre de\u011ferine g\u00f6re geriye ya string bir value yahut da null de\u011ferlerini d\u00f6nd\u00fcrecektir. G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere parametreye verilen &#8220;true&#8221; de\u011feri sayesinde kesinlikle geriye bir de\u011fer d\u00f6necek ve bu de\u011fer \u00fczerinde bir i\u015flem yap\u0131ld\u0131\u011f\u0131 taktirde compiler\u0131n hata vermemesi ve bizim gibi durumdan haberdar edilmesi i\u00e7in kesinlikle null bir durumun s\u00f6z konusu olmad\u0131\u011f\u0131n\u0131 !(null-forgiving) operat\u00f6r\u00fc ile bildirmekte ve nihayetinde uyar\u0131lar\u0131n kald\u0131r\u0131ld\u0131\u011f\u0131n\u0131 g\u00f6rmekteyiz.\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Yeri gelmi\u015fken null-forgiving(!) operat\u00f6r\u00fcne dair daha detayl\u0131 bir izahette bulunabilmek i\u00e7in a\u015fa\u011f\u0131daki kod blo\u011fundaki \u00f6rne\u011fide incelemenizi tavsiye ederim.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n            string s1 = null; \/\/Converting null literal or possible null value to non - nullable type.\r\n            string s2 = null!; \/\/Ok\r\n            string s3 = default!; \/\/Ok\r\n<\/pre>\n<h3>Preconditions Attributes(\u00d6n Ko\u015ful Nitelikler)<\/h3>\n<h4>AllowNull<\/h4>\n<p>Bir propertye null de\u011fer set edildi\u011fi taktirde null yerine bo\u015f bir de\u011fer d\u00f6nd\u00fcrebilmesi i\u00e7in a\u015fa\u011f\u0131daki gibi \u00e7al\u0131\u015fabiliriz.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-2.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"348\" height=\"324\" class=\"aligncenter size-full wp-image-12753\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-2.png 348w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-2-300x279.png 300w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><br \/>\nG\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere &#8220;Value&#8221; propertysi &#8220;?&#8221; operat\u00f6r\u00fc ile nullable yap\u0131ld\u0131\u011f\u0131 halde i\u00e7erisinde her daim null d\u0131\u015f\u0131nda bir de\u011fer d\u00f6nd\u00fcrmektedir. Lakin 10. sat\u0131rda verilen null de\u011ferine kar\u015f\u0131l\u0131k 11. sat\u0131rdaki hamle yap\u0131ld\u0131\u011f\u0131 taktirde g\u00f6rseldeki uyar\u0131 verilmektedir.<\/p>\n<p>Bu duruma istinaden bizde property&#8217;de ki nullable \u00f6zelli\u011fini kald\u0131ral\u0131m ve birde \u00f6yle \u00e7al\u0131\u015fal\u0131m.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-3.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"441\" height=\"361\" class=\"aligncenter size-full wp-image-12755\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-3.png 441w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-3-300x246.png 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/a><br \/>\nHoopbala! Bu \u015fekilde  bir \u00e7al\u0131\u015fma sergiledi\u011fimizde de &#8220;Value&#8221; propertysinin null de\u011fer alamayaca\u011f\u0131 ifade edilmektedir.<\/p>\n<p>\u0130\u015fte bu tarz <em>a\u015fa\u011f\u0131 t\u00fck\u00fcrsem sakal, yukar\u0131 t\u00fck\u00fcrsem b\u0131y\u0131k<\/em> durumlar\u0131nda &#8220;AllowNull&#8221; attributeunu kullanarak hem i\u015fimizi g\u00f6rebilir, hemde compiler\u0131 rahatlatabiliriz.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-4.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"334\" height=\"263\" class=\"aligncenter size-full wp-image-12759\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-4.png 334w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-4-300x236.png 300w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/a><\/p>\n<blockquote><p><em><strong style=\"color:orange;\">Nullable olmayan bir referans &#8220;AllowNull&#8221; ile null de\u011fer kar\u015f\u0131layabilir bir \u00f6zellik kazanmaktad\u0131r.<\/strong><\/em><\/p><\/blockquote>\n<h4>DisallowNull<\/h4>\n<p>Yukar\u0131daki &#8220;AllowNull&#8221; senaryosunun tam tersi durumunda ise &#8220;DisallowNull&#8221; attributeunu kullanabiliriz. Yani nullable olan bir propertye yinede null de\u011fer girilmemesine dair bir uyar\u0131da bulunulmas\u0131n\u0131 istiyorsan\u0131z, kullanabilirsiniz.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-5.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"459\" height=\"387\" class=\"aligncenter size-full wp-image-12766\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-5.png 459w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-5-300x253.png 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/a><br \/>\nYukar\u0131daki g\u00f6rseli incelerseniz e\u011fer; nullable olan &#8220;Value&#8221; propertysi &#8220;DisallowNull&#8221; attribute ile i\u015faretlenerek null de\u011fer verilmemesine dair uyar\u0131 verdirilmekte ve b\u00f6ylece i\u015faretlenen i\u015flemde al\u0131nabilecek olas\u0131 hatan\u0131n \u00f6n\u00fcne derleyici a\u015famas\u0131nda ge\u00e7ilmeye \u00e7al\u0131\u015f\u0131lmaktad\u0131r.<\/p>\n<blockquote><p><em><strong style=\"color:red;\">&#8220;DisallowNull&#8221; ile nullable olan referanslara null de\u011fer atanmas\u0131 yasaklan\u0131r.<\/strong><\/em><\/p><\/blockquote>\n<h4>AllowNull\/DisallowNull Attributelar\u0131n\u0131n ref Parametrelerinde Kullan\u0131m\u0131<\/h4>\n<p>A\u015fa\u011f\u0131daki g\u00f6rsel olarak yay\u0131nlanm\u0131\u015f durumlar\u0131 mukayese ediniz;<\/p>\n<table>\n<thead>\n<tr>\n<th colspan=\"2\">AllowNull<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-6.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"418\" height=\"328\" class=\"aligncenter size-full wp-image-12771\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-6.png 418w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-6-300x235.png 300w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-7.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"429\" height=\"225\" class=\"aligncenter size-full wp-image-12772\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-7.png 429w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-7-300x157.png 300w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere ref parametresinde AllowNull ile null bir de\u011fer al\u0131nabilece\u011fini bildirmi\u015f bulunmaktay\u0131z. Aksi taktirde developer uyar\u0131lmaktad\u0131r.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<thead>\n<tr>\n<th colspan=\"2\">DisallowNull<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-8.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-8.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"371\" height=\"225\" class=\"aligncenter size-full wp-image-12775\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-8.png 371w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-8-300x182.png 300w\" sizes=\"auto, (max-width: 371px) 100vw, 371px\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-9.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-9.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"465\" height=\"328\" class=\"aligncenter size-full wp-image-12776\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-9.png 465w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-9-300x212.png 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">Ref parametresinin nullable olma durumundan dolay\u0131, null de\u011ferinin verilmesi durumunda olas\u0131 null exception hatalar\u0131n\u0131n \u00f6n\u00fcne ge\u00e7ilmesi i\u00e7in ilgili parametre DisallowNull ile i\u015faretlenmi\u015ftir.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Post-Condition Attributes(Ko\u015ful Sonras\u0131 Nitelikler)<\/h3>\n<h4>MaybeNull<\/h4>\n<p>Bir metot geriye nullable de\u011fer d\u00f6nd\u00fcrmese dahi &#8220;null&#8221; d\u00f6nebilece\u011fini bildirmek i\u00e7in kullan\u0131l\u0131r.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-10.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-10.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"273\" height=\"219\" class=\"aligncenter size-full wp-image-12780\" \/><\/a><\/p>\n<blockquote><p><em><strong style=\"color:purple;\">&#8220;MaybeNull&#8221; ile geri d\u00f6n\u00fc\u015f de\u011feri nullable olmayan metotlarda geriye null de\u011feri d\u00f6nd\u00fcr\u00fclebilir.<\/strong><\/em><\/p><\/blockquote>\n<h4>NotNull<\/h4>\n<table>\n<thead>\n<tr>\n<th>Kullanmazken<\/th>\n<th>Kullan\u0131rken<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-11.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-11.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"268\" height=\"199\" class=\"aligncenter size-full wp-image-12782\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-12.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-12.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"270\" height=\"220\" class=\"aligncenter size-full wp-image-12783\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">Yukar\u0131daki ekran g\u00f6r\u00fcnt\u00fclerinden de anla\u015f\u0131laca\u011f\u0131 \u00fczere geri d\u00f6n\u00fc\u015f de\u011feri nullable olan bir metodun null de\u011fer d\u00f6nd\u00fcrmeyece\u011fini belirtir.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote><p><em><strong>&#8220;NotNull&#8221; ile geri d\u00f6n\u00fc\u015f de\u011feri nullable olan metotlarda geriye null de\u011ferinin d\u00f6nd\u00fcr\u00fclmesi yasaklanmakta\/engellenmektedir.<\/strong><\/em><\/p><\/blockquote>\n<h3>Conditional Post-Conditions Attributes(Ko\u015fullu Nitelikler)<\/h3>\n<h4>NotNullWhen<\/h4>\n<p>Bir metodun geri d\u00f6n\u00fc\u015f de\u011ferine g\u00f6re parametresinin null olup olmayaca\u011f\u0131n\u0131 belirtmek i\u00e7in kullan\u0131l\u0131r.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-13.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-13.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"593\" height=\"225\" class=\"aligncenter size-full wp-image-12789\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-13.png 593w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-13-300x114.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/a><br \/>\nYukar\u0131daki \u00f6rne\u011fin out parametre \u00fczerinden verilmesi ilgili attributen metoda dair di\u011fer t\u00fcm parametre \u00e7e\u015fitleri i\u00e7in kullan\u0131lmayaca\u011f\u0131 anlam\u0131na gelmemektedir! <\/p>\n<blockquote><p><em><strong style=\"color:maroon;\">&#8220;NotNullWhen&#8221; ile bir metodun geri d\u00f6n\u00fc\u015f de\u011ferine g\u00f6re herhangi bir parametrenin null olup olmayaca\u011f\u0131 belirlenir.<\/strong><\/em><\/p><\/blockquote>\n<h4>MayBeNullWhen<\/h4>\n<p>&#8220;NotNullWhen&#8221; attribute&#8217;una nazaran, nullable olmayan bir parametrenin metodun boolean tipteki d\u00f6n\u00fc\u015f de\u011ferine g\u00f6re null olup olmayaca\u011f\u0131n\u0131 belirlemektedir.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-14.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-14.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"608\" height=\"225\" class=\"aligncenter size-full wp-image-12791\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-14.png 608w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-14-300x111.png 300w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/a><br \/>\nYukar\u0131daki kod blo\u011funu incelerseniz e\u011fer, &#8220;Metot&#8221; isimli metodun geri d\u00f6n\u00fc\u015f de\u011feri false oldu\u011fu taktirde &#8220;value&#8221; isimli nullable olmayan parametre i\u00e7in yinede null de\u011fer alabilece\u011fini bildirmi\u015f bulunmaktay\u0131z.<\/p>\n<blockquote><p><em><strong style=\"color:green;\">&#8220;MayBeNullWhen&#8221; ile bir metodun nullable olmayan parametresinin, metodunun boolean tipte geri d\u00f6n\u00fc\u015f de\u011ferine g\u00f6re null olup olmayaca\u011f\u0131n\u0131 belirler.<\/strong><\/em><\/p><\/blockquote>\n<h4>NotNullIfNotNull<\/h4>\n<p>Bir metodun geri d\u00f6n\u00fc\u015f de\u011ferinin null olup olmamas\u0131n\u0131 herhangi bir parametresinin de\u011ferine ba\u011flayan attribute&#8217;dur.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n        &#x5B;return: NotNullIfNotNull(parameterName: &quot;param1&quot;)]\r\n        static string? Metot(string? param1, string? param2)\r\n        {\r\n            return null;\r\n        }\r\n<\/pre>\n<p>Yukar\u0131daki kod blo\u011funu incelerseniz e\u011fer, &#8220;param1&#8221; isimli parametrenin de\u011feri null oldu\u011fu taktirde ilgili metot geriye null de\u011fer d\u00f6nd\u00fcrebilir. Aksi taktirde d\u00f6nd\u00fcremez.<\/p>\n<h3>Flow Attributes(Ak\u0131\u015f Nitelikler)<\/h3>\n<h4>DoesNotReturn<\/h4>\n<p>Bir metodun geri d\u00f6n\u00fc\u015f de\u011ferinin olmad\u0131\u011f\u0131n\u0131 ifade eder.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n        &#x5B;DoesNotReturn]\r\n        static void NotReturn(string value)\r\n        {\r\n            throw new ArgumentNullException(value);\r\n        }\r\n<\/pre>\n<h4>DoesNotReturnIf<\/h4>\n<p>Bir metodun boolean tipteki parametresindeki de\u011fere g\u00f6re geriye bir \u015fey d\u00f6nd\u00fcr\u00fcp d\u00f6nd\u00fcrmeyece\u011fini ifade eder.<\/p>\n<p>Bunu a\u015fa\u011f\u0131daki gibi manevratik algoritmalar i\u00e7in kullanabiliriz;<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-15.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-15.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"554\" height=\"247\" class=\"aligncenter size-full wp-image-12798\" \/><\/a><\/td>\n<p>&#8220;condition&#8221; parametresi &#8220;false&#8221; ise ilgili &#8220;NotReturnIf&#8221; isimli metodun geriye bir de\u011fer d\u00f6nd\u00fcrmeyece\u011fini ifade etmektedir. Dolay\u0131s\u0131yla &#8220;Main&#8221; metodu i\u00e7erisinde &#8220;value&#8221; isimli de\u011fi\u015fken &#8220;NotReturnIf&#8221; isimli metot i\u00e7erisinde kontrol edilmekte ve false oldu\u011fu taktirde ilgili metot taraf\u0131ndan hata f\u0131rlat\u0131laca\u011f\u0131 kesin olarak bilinmektedir. B\u00f6ylece &#8220;<em>_ = value.length<\/em>&#8221; kodundaki olas\u0131 hata derleyici taraf\u0131ndan g\u00f6z ard\u0131 edilebilmektedir.<\/p>\n<h3>Generic Constraint(notnull)<\/h3>\n<p>Bir Generic yap\u0131lanmada generic parametrenin null olmamas\u0131n\u0131 istiyorsak e\u011fer <em>notnull<\/em> constraintini a\u015fa\u011f\u0131daki gibi uygulamam\u0131z yeterlidir.<br \/>\n<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-16.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-16.png\" alt=\"C# 8.0 - Nullable Reference Types\" width=\"667\" height=\"321\" class=\"aligncenter size-full wp-image-12805\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-16.png 667w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2019\/12\/C-8.0-Nullable-Reference-Types-16-300x144.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/a><\/p>\n<p>Ayriyetten k\u00fc\u00e7\u00fck bir parantez olarak &#8220;notnull&#8221; constraintine \u00f6rnek olarak genel k\u00fclt\u00fcr mahiyetinde &#8220;Dictionary&#8221; s\u0131n\u0131f\u0131n\u0131 verebiliriz;<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\npublic class Dictionary&lt;TKey, &#x5B;NullableAttribute(2)] TValue&gt; : ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable, IDictionary&lt;TKey, TValue&gt;, IReadOnlyCollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IReadOnlyDictionary&lt;TKey, TValue&gt;, ICollection, IDictionary, IDeserializationCallback, ISerializable where TKey : notnull\r\n{\r\n   ....\r\n}\r\n<\/pre>\n<p>Evet, b\u00f6ylece C# programlama dilinin 8.0 versiyonunda en heyecan verici geli\u015fmelerden biri olan <em>Nullable Reference Types<\/em> \u00f6zelli\u011fini incelemi\u015f bulunmaktay\u0131z. Muhtemeldir ki, i\u00e7eri\u011fimizin ilk paragraflar\u0131nda bahsedilen redundancy kodlar\u0131 developera yapm\u0131\u015f oldu\u011fu yard\u0131m neticesinde azaltaca\u011f\u0131 ve tip g\u00fcvenli\u011fine(type safety) daha anlaml\u0131 bir yeni boyut kazand\u0131raca\u011f\u0131 g\u00f6z\u00fckmektedir. Hay\u0131rl\u0131s\u0131 diyelim \ud83d\ude42<\/p>\n<p>\u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<br \/>\nSonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/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>Merhaba, D\u00fcn d\u00fcnde kald\u0131, yar\u0131nlar ise \u015fekilleniyorken biz \u015fimdinin s\u0131n\u0131rlar\u0131 i\u00e7erisinde asl\u0131nda sade ve sadece basit ve tek kare bir an\u0131 ya\u015f\u0131yoruz \u015fu fani d\u00fcnyada. Her \u015fey de\u011fi\u015fiyor. Bu de\u011fi\u015fimden en b\u00fcy\u00fck at\u0131l\u0131mlar\u0131 geli\u015febilenler&#46;&#46;&#46;<!-- 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":11028,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2739,3033,12,2857],"tags":[3075,3091,3079,3072,2858,3085,3080,3092,3093,3090,3094,3082,3086,3084,3088,3083,3089,3087,3074,3076,3070,3073,3078,3081,3077,3071,3095],"class_list":["post-12675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net-core","category-net-core-3-0","category-c-sharp-c","category-c-8-0","tag-3075","tag-akis-nitelikler","tag-allownull","tag-billion-dollar-mistake","tag-c-8-0","tag-conditional-post-conditions-attributes","tag-disallownull","tag-doesnotreturn","tag-doesnotreturnif","tag-flow-attributes","tag-generic-constraint","tag-kosul-sonrasi-nitelikler","tag-kosullu-nitelikler","tag-maybenull","tag-maybenullwhen","tag-notnull","tag-notnullifnotnull","tag-notnullwhen","tag-null-affedici-operatoru","tag-null-forgiving","tag-nullable-reference-types","tag-nullreferenceexception","tag-on-kosul-nitelikler","tag-post-condition-attributes","tag-preconditions-attributes","tag-redundancy","tag-type-safety"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/12675","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=12675"}],"version-history":[{"count":112,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/12675\/revisions"}],"predecessor-version":[{"id":12811,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/12675\/revisions\/12811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/11028"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=12675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=12675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=12675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}