{"id":530,"date":"2016-01-31T00:09:50","date_gmt":"2016-01-30T22:09:50","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=530"},"modified":"2016-01-31T00:09:50","modified_gmt":"2016-01-30T22:09:50","slug":"asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/","title":{"rendered":"Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama"},"content":{"rendered":"<p>Merhaba arkada\u015flar. Bu makale konumda ise Asp.NET Web API&#8217;da nas\u0131l versiyonlama yap\u0131labilece\u011fini g\u00f6r\u00fcrken\u00a0bir yandan da\u00a0action method&#8217;lar \u00fczerinde nas\u0131l custom constraint&#8217;ler\u00a0ekleyebilece\u011fimizi\u00a0g\u00f6rece\u011fiz. Dilerseniz fazla uzatmadan hemen konuya girelim. :)<\/p>\n<p>Asp.NET Web API i\u00e7erisinde <strong>IHttpRouteConstraint<\/strong> interface\u2019ini implemente ederek, custom constraint olu\u015fturabilmek m\u00fcmk\u00fcnd\u00fcr. \u201cSystem.Web.Http.Routing\u201d namespace\u2019i alt\u0131nda bulunan IHttpRouteConstraint interface\u2019i, a\u015fa\u011f\u0131daki gibi bir method imzas\u0131na sahiptir.<\/p>\n<pre class=\"lang:c# decode:true \">namespace System.Web.Http.Routing\r\n{\r\n    \/\/\r\n    \/\/ Summary:\r\n    \/\/     Represents a base class route constraint.\r\n    public interface IHttpRouteConstraint\r\n    {\r\n        \/\/\r\n        \/\/ Summary:\r\n        \/\/     Determines whether this instance equals a specified route.\r\n        \/\/\r\n        \/\/ Parameters:\r\n        \/\/   request:\r\n        \/\/     The request.\r\n        \/\/\r\n        \/\/   route:\r\n        \/\/     The route to compare.\r\n        \/\/\r\n        \/\/   parameterName:\r\n        \/\/     The name of the parameter.\r\n        \/\/\r\n        \/\/   values:\r\n        \/\/     A list of parameter values.\r\n        \/\/\r\n        \/\/   routeDirection:\r\n        \/\/     The route direction.\r\n        \/\/\r\n        \/\/ Returns:\r\n        \/\/     True if this instance equals a specified route; otherwise, false.\r\n        bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary&lt;string, object&gt; values, HttpRouteDirection routeDirection);\r\n    }\r\n}<\/pre>\n<p>Dilerseniz bir \u00f6rnek \u00fczerinde IHttpRouteConstraint interface\u2019inin, implementasyonunu ger\u00e7ekle\u015ftirelim. Ger\u00e7ekle\u015ftirecek oldu\u011fumuz \u00f6rnekte HTTP Header\u2019\u0131 kullanarak, controller \u00fczerinde custom olarak versiyonlama i\u015flemi ger\u00e7ekle\u015ftirece\u011fiz.<\/p>\n<p>\u015eimdi <strong>VersionConstraint<\/strong> isminde yeni bir class olu\u015ftural\u0131m ve IHttpRouteConstraint interface\u2019ini a\u015fa\u011f\u0131daki gibi implemente edelim.<\/p>\n<pre class=\"lang:c# decode:true \">using System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Net.Http;\r\nusing System.Web.Http.Routing;\r\n\r\nnamespace RoutingExample.Constraints\r\n{\r\n    public class VersionConstraint : IHttpRouteConstraint\r\n    {\r\n        private const int DEFAULT_VERSION = 1;\r\n        private int _AllowedVersion;\r\n\r\n        public VersionConstraint(int allowedVersion)\r\n        {\r\n            _AllowedVersion = allowedVersion;\r\n        }\r\n\r\n        public bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary&lt;string, object&gt; values, HttpRouteDirection routeDirection)\r\n        {\r\n            if (routeDirection == HttpRouteDirection.UriResolution)\r\n            {\r\n                int version = GetVersionFromRequestHeader(request) ?? DEFAULT_VERSION;\r\n                if (version == _AllowedVersion)\r\n                {\r\n                    return true;\r\n                }\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        private int? GetVersionFromRequestHeader(HttpRequestMessage request)\r\n        {\r\n            IEnumerable&lt;string&gt; headerValues;\r\n            string val = string.Empty;\r\n\r\n            if (request.Headers.TryGetValues(\"api-version\", out headerValues) &amp;&amp; headerValues.Count() == 1)\r\n            {\r\n                val = headerValues.First();\r\n            }\r\n\r\n            int versionFromHeader;\r\n\r\n            if (!string.IsNullOrEmpty(val) &amp;&amp; int.TryParse(val, out versionFromHeader))\r\n            {\r\n                return versionFromHeader;\r\n            }\r\n\r\n            return null;\r\n        }\r\n    }\r\n}<\/pre>\n<p>Implementasyona ilk bakt\u0131\u011f\u0131m\u0131zda, constructor arac\u0131l\u0131\u011f\u0131 ile d\u0131\u015far\u0131dan ge\u00e7erli olmas\u0131n\u0131 istedi\u011fimiz \u201callowedVersion\u201d parametresini al\u0131yoruz. <strong>IHttpRouteConstraint<\/strong> interface\u2019inden gelen \u201cMatch\u201d method\u2019unda ise; Request\u2019in Header\u2019\u0131 \u00fczerinde custom olarak set edilmi\u015f olan \u201capi-version\u201d bilgisini alarak, constructor \u00fczerinden elde etmi\u015f oldu\u011fumuz \u201callowedVersion\u201d parametresi ile kar\u015f\u0131la\u015ft\u0131r\u0131yoruz.<br \/>\nArt\u0131k olu\u015fturmu\u015f oldu\u011fumuz VersionConstraint class\u2019\u0131n\u0131 route belirtirken kullanabilmek i\u00e7in <strong>RouteFactoryAttribute<\/strong> abstract class\u2019\u0131ndan yararlanarak, a\u015fa\u011f\u0131daki gibi yeni bir attribute olu\u015ftural\u0131m ve implemente edelim.<\/p>\n<pre class=\"lang:c# decode:true \">using RoutingExample.Constraints;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Web.Http.Routing;\r\n\r\nnamespace RoutingExample.Attributes\r\n{\r\n    public class VersionedRouteAttribute : RouteFactoryAttribute\r\n    {\r\n        private int _AllowedVersion;\r\n\r\n        public VersionedRouteAttribute(string template, int allowedVersion)\r\n            : base(template)\r\n        {\r\n            _AllowedVersion = allowedVersion;\r\n        }\r\n\r\n        public override IDictionary&lt;String, Object&gt; Constraints\r\n        {\r\n            get\r\n            {\r\n                var constraints = new HttpRouteValueDictionary();\r\n                constraints.Add(\"version\", new VersionConstraint(_AllowedVersion));\r\n\r\n                return constraints;\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Implementasyona bakt\u0131\u011f\u0131m\u0131zda ilk parametrede constructor \u00fczerinden route template\u2019i al\u0131p, RouteFactoryAttribute\u2019\u00fcn construtor\u2019\u0131na ge\u00e7iyoruz. \u0130kinci parametrede ise ge\u00e7erli olmas\u0131n\u0131 istedi\u011fimiz versiyon numaras\u0131n\u0131 alarak, RouteFactoryAttribute \u00fczerinde bulunan <strong>Constraints<\/strong> dictionary\u2019sine VersionConstraint\u2019i, ge\u00e7erli olmas\u0131n\u0131 istedi\u011fimiz versiyon numaras\u0131 ile beraber ekliyoruz.<\/p>\n<p>Constraint&#8217;imiz haz\u0131r oldu\u011funa g\u00f6re \u015fimdi yeni bir controller olu\u015fturarak kullan\u0131m\u0131na bir bakal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true \">public class Order_V1Controller : ApiController\r\n{\r\n    [VersionedRoute(\"api\/Order\", 1)]\r\n    [HttpGet]\r\n    public IEnumerable&lt;Order&gt; Get()\r\n    {\r\n        return null;\r\n    }\r\n}<\/pre>\n<p>Order_V1Controller\u2019a bakt\u0131\u011f\u0131m\u0131zda Get method\u2019u \u00fczerinde <strong>VersionedRoute<\/strong> attribute\u2019\u00fcn\u00fc g\u00f6rebilmekteyiz. \u0130lk parametresinde ge\u00e7erli olmas\u0131n\u0131 istedi\u011fimiz template route\u2019u g\u00f6nderirken, ikinci parametresinde ise ge\u00e7erli olmas\u0131n\u0131 istedi\u011fimiz <strong>versiyon numaras\u0131n\u0131<\/strong> set ediyoruz.<br \/>\nArt\u0131k her \u015fey haz\u0131r oldu\u011funa g\u00f6re \u00f6rne\u011fimizi deneyebilmek i\u00e7in Fiddler \u00fczerinden \u201capi\/Order\u201d URI\u2019\u0131na bir GET iste\u011finde bulunaca\u011f\u0131z. A\u015fa\u011f\u0131da \u015fekildeki gibi GET iste\u011finde bulunurken HTTP Request Header\u2019\u0131na, \u201capi-version\u201d parametresini ekleyerek \u201c2\u201d de\u011ferini verelim.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-531 lazyload\" data-src=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.1.jpg\" alt=\"10.6.2.1.1\" width=\"644\" height=\"366\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.1.jpg 644w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.1-300x170.jpg 300w\" data-sizes=\"(max-width: 644px) 100vw, 644px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 644px; --smush-placeholder-aspect-ratio: 644\/366;\" \/><\/a><\/p>\n<p>Fiddler \u00fczerinde GET request\u2019ini yukar\u0131da \u015fekildeki gibi ayarlad\u0131ktan sonra execute edelim ve IHttpRouteConstraint interface\u2019ini implemente etti\u011fimiz <strong>VersionConstraint<\/strong> class\u2019\u0131 i\u00e7erisindeki \u201cMatch\u201d method\u2019una, debug an\u0131nda bir bakal\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.2.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-532 lazyload\" data-src=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.2.jpg\" alt=\"10.6.2.1.2\" width=\"719\" height=\"259\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.2.jpg 719w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.2-300x108.jpg 300w\" data-sizes=\"(max-width: 719px) 100vw, 719px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 719px; --smush-placeholder-aspect-ratio: 719\/259;\" \/><\/a><\/p>\n<p>GET iste\u011finde bulundu\u011fumuz i\u00e7in request, \u00f6ncelikle Order_V1Controller i\u00e7erisindeki Get method\u2019una d\u00fc\u015fm\u00fc\u015ft\u00fcr. Get method\u2019una eklemi\u015f oldu\u011fumuz <strong>VersionedRoute<\/strong> attribute\u2019\u00fcnden dolay\u0131, hen\u00fcz method invoke edilmeden \u00f6nce constraint kontrol\u00fc i\u00e7in request, \u201cMatch\u201d method\u2019una d\u00fc\u015fm\u00fc\u015ft\u00fcr.<\/p>\n<blockquote><p><strong>NOT:<\/strong> Asp.NET Web API uygulamas\u0131 ilk kez aya\u011fa kalkt\u0131\u011f\u0131nda, action method \u00fczerine eklemi\u015f oldu\u011fumuz \u201cVersionedRoute\u201d attribute\u2019\u00fc arac\u0131l\u0131\u011f\u0131 ile Constraints property\u2019si i\u00e7erisine olu\u015fturmu\u015f oldu\u011fumuz \u201cVersionConstraint\u201d class\u2019\u0131 eklenmektedir. Bu sayede ilgili action method\u2019a bir request geldi\u011finde, VersionConstraint class\u2019\u0131 i\u00e7erisindeki \u201cMatch\u201d method\u2019una d\u00fc\u015fmektedir.<\/p><\/blockquote>\n<p><a href=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.3.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-533 lazyload\" data-src=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.3.jpg\" alt=\"10.6.2.1.3\" width=\"718\" height=\"352\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.3.jpg 718w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.3-300x147.jpg 300w\" data-sizes=\"(max-width: 718px) 100vw, 718px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 718px; --smush-placeholder-aspect-ratio: 718\/352;\" \/><\/a><\/p>\n<p>Match method\u2019u i\u00e7erisinde ise Request Header\u2019\u0131 \u00fczerinde g\u00f6ndermi\u015f oldu\u011fumuz \u201capi-version\u201d bilgisini elde edebilmek i\u00e7in <strong>GetVersionFromRequestHeader<\/strong> method\u2019u \u00e7a\u011f\u0131r\u0131l\u0131yor ve yukar\u0131daki gibi versiyon numaras\u0131 Request Header \u00fczerinden elde ediliyor.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.4.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-534 lazyload\" data-src=\"\/wp-content\/uploads\/2016\/01\/10.6.2.1.4.jpg\" alt=\"10.6.2.1.4\" width=\"718\" height=\"273\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.4.jpg 718w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2016\/01\/10.6.2.1.4-300x114.jpg 300w\" data-sizes=\"(max-width: 718px) 100vw, 718px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 718px; --smush-placeholder-aspect-ratio: 718\/273;\" \/><\/a><\/p>\n<p>Match method\u2019u versiyon numaras\u0131n\u0131 elde ettikten sonra VersionConstraint attribute\u2019\u00fcn\u00fc kullan\u0131rken, g\u00f6ndermi\u015f oldu\u011fumuz \u201cAllowedVersion\u201d parametresi ile kar\u015f\u0131la\u015ft\u0131rarak, bu constraint\u2019in match olup olmad\u0131\u011f\u0131na karar veriyor. Asp.NET Web API bu i\u015flemin sonucunda ise ilgili route\u2019un ge\u00e7erli olup olmayaca\u011f\u0131na karar vermektedir.<br \/>\nBiz \u00f6rne\u011fimizde \u201cAllowedVersion\u201d parmetresini \u201c1\u201d olarak belirledi\u011fimiz ve Request Header \u00fczerinden \u201capi-version\u201d parametresini \u201c2\u201d olarak g\u00f6nderdi\u011fimiz i\u00e7in, Asp.NET Web API bize a\u015fa\u011f\u0131daki gibi bir sonu\u00e7 geri d\u00f6necektir.<\/p>\n<pre class=\"lang:c# decode:true \">HTTP\/1.1 404 Not Found\r\nCache-Control: no-cache\r\nPragma: no-cache\r\nContent-Type: application\/json; charset=utf-8\r\nExpires: -1\r\nServer: Microsoft-IIS\/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcR8OWS0FMUFxEb2N1bWVudHNcVmlzdWFsIFN0dWRpbyAyMDE1XFByb2plY3RzXFJvdXRpbmdFeGFtcGxlXFJvdXRpbmdFeGFtcGxlXGFwaVxPcmRlcg==?=\r\nX-Powered-By: ASP.NET\r\nDate: Sat, 30 Jan 2016 21:21:16 GMT\r\nContent-Length: 195\r\n\r\n{\"Message\":\"No HTTP resource was found that matches the request URI 'http:\/\/localhost:65268\/api\/Order'.\",\"MessageDetail\":\"No action was found on the controller 'Order' that matches the request.\"}\r\n<\/pre>\n<p>Bu durumda \u201capi-version\u201d parametresini \u201c1\u201d olarak g\u00f6ndermi\u015f olsayd\u0131k, Get method\u2019u ba\u015far\u0131l\u0131 bir \u015fekilde invoke ediliyor olacakt\u0131. Bu\u00a0\u015fekilde\u00a0action method baz\u0131nda versiyonlama i\u015flemi yapabilmek m\u00fcmk\u00fcn olmaktad\u0131r.<\/p>\n<p>Dilerseniz sizde\u00a0<strong>IHttpRouteConstraint<\/strong> interface&#8217;ini custom olarak implemente ederek, Match method&#8217;u i\u00e7erisinde diledi\u011finiz i\u015flemleri ger\u00e7ekle\u015ftirebilirsiniz. Ger\u00e7ekle\u015ftirmi\u015f oldu\u011fumuz \u00f6rne\u011fin uygulamas\u0131na ekten eri\u015febilirsiniz. Biraz b\u0131rakt\u0131\u011f\u0131m aradan sonra umar\u0131m faydal\u0131 bir makale olmu\u015ftur.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2016\/01\/RoutingExample.rar\">RoutingExample<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba arkada\u015flar. Bu makale konumda ise Asp.NET Web API&#8217;da nas\u0131l versiyonlama yap\u0131labilece\u011fini g\u00f6r\u00fcrken\u00a0bir yandan da\u00a0action method&#8217;lar \u00fczerinde nas\u0131l custom constraint&#8217;ler\u00a0ekleyebilece\u011fimizi\u00a0g\u00f6rece\u011fiz. Dilerseniz fazla uzatmadan hemen konuya girelim. :) Asp.NET Web API i\u00e7erisinde IHttpRouteConstraint interface\u2019ini implemente ederek, custom constraint olu\u015fturabilmek m\u00fcmk\u00fcnd\u00fcr. \u201cSystem.Web.Http.Routing\u201d namespace\u2019i alt\u0131nda bulunan IHttpRouteConstraint interface\u2019i,&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[149,151,150,148],"class_list":["post-530","post","type-post","status-publish","format-standard","hentry","category-asp-net-web-api","tag-asp-net-web-api-ihttprouteconstraint","tag-asp-net-web-api-routing","tag-asp-net-web-api-versiyonlama","tag-ihttprouteconstraint","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":false,"content":false,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Asp.NET Web API&#039;da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Asp.NET Web API&#039;da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-30T22:09:50+00:00\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama\",\"datePublished\":\"2016-01-30T22:09:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/\"},\"wordCount\":734,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"keywords\":[\"Asp.NET Web API IHttpRouteConstraint\",\"Asp.NET Web API Routing\",\"Asp.NET Web API versiyonlama\",\"IHttpRouteConstraint\"],\"articleSection\":[\"Asp.Net Web API\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/\",\"name\":\"Asp.NET Web API'da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"datePublished\":\"2016-01-30T22:09:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Asp.NET Web API'da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/","og_locale":"tr_TR","og_type":"article","og_title":"Asp.NET Web API'da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2016-01-30T22:09:50+00:00","author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"5 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama","datePublished":"2016-01-30T22:09:50+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/"},"wordCount":734,"commentCount":3,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"keywords":["Asp.NET Web API IHttpRouteConstraint","Asp.NET Web API Routing","Asp.NET Web API versiyonlama","IHttpRouteConstraint"],"articleSection":["Asp.Net Web API"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/","url":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/","name":"Asp.NET Web API'da IHttpRouteConstraint Implementasyonu ile Versiyonlama - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"datePublished":"2016-01-30T22:09:50+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/asp-net-web-apida-ihttprouteconstraint-implementasyonu-ile-versiyonlama\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"Asp.NET Web API&#8217;da IHttpRouteConstraint Implementasyonu ile Versiyonlama"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=530"}],"version-history":[{"count":3,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/530\/revisions"}],"predecessor-version":[{"id":538,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/530\/revisions\/538"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}