{"id":1481,"date":"2017-06-16T10:34:01","date_gmt":"2017-06-16T07:34:01","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=1481"},"modified":"2017-12-11T21:58:20","modified_gmt":"2017-12-11T18:58:20","slug":"asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/","title":{"rendered":"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#8217;e Deploy"},"content":{"rendered":"<p>Merhaba arkada\u015flar.<\/p>\n<p><strong>ASP.NET Core<\/strong> serisine asl\u0131nda uzun bir s\u00fcredir giri\u015f yapmay\u0131 d\u00fc\u015f\u00fcn\u00fcyordum fakat, bir t\u00fcrl\u00fc f\u0131rsat bulamam\u0131\u015ft\u0131m. :) Son d\u00f6nemlerde do\u011fan baz\u0131 ihtiya\u00e7lar\u0131m\u0131zdan dolay\u0131 (kolayca dockerize edebilmek vb.), bu aralar aktif olarak ASP.NET Core \u00fczerinde development yapmaktay\u0131m. Bu sebep ile ara ara seriler halinde ASP.NET Core \u00fczerine irili ufakl\u0131 makaleler yazmaya\u00a0\u00e7al\u0131\u015faca\u011f\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/asp-net-core.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1491 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/asp-net-core.jpg\" alt=\"\" width=\"880\" height=\"296\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core.jpg 880w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-300x101.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/asp-net-core-768x258.jpg 768w\" data-sizes=\"(max-width: 880px) 100vw, 880px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 880px; --smush-placeholder-aspect-ratio: 880\/296;\" \/><\/a><\/p>\n<p>Bu makale kapsam\u0131nda ASP.NET Core ile lightweight bir <strong>RESTful API<\/strong> geli\u015ftirece\u011fiz. Bunun i\u00e7in data i\u015flemlerinde\u00a0<strong>Dapper<\/strong>\u00a0ve\u00a0<strong>Repository<\/strong>\u00a0pattern&#8217;\u0131n\u0131 kullan\u0131p,\u00a0global exception&#8217;lar\u0131 ise\u00a0<strong>Serilog<\/strong> ile handle edece\u011fiz. Geli\u015ftirmenin ard\u0131ndan ise bir <strong>Swagger<\/strong> aray\u00fcz\u00fc ekleyip,\u00a0<strong>Azure App Services<\/strong> \u00fczerine nas\u0131l deploy edebiliriz gibi i\u015flemleri ger\u00e7ekle\u015ftirmeye \u00e7al\u0131\u015faca\u011f\u0131z.<\/p>\n<h5>Proje Structure&#8217;\u0131n\u0131 Olu\u015fturma<\/h5>\n<p>\u00d6ncelikle <em>PowerShell<\/em> \u00fczerinden &#8220;<em>aspnetcore-rest-api-with-dapper<\/em>&#8221; isminde bir folder olu\u015fturarak, a\u015fa\u011f\u0131daki gibi &#8220;<em>dotnet new webapi<\/em>&#8221; komutu ile bir ASP.NET Core Web API projesi olu\u015ftural\u0131m. Ard\u0131ndan &#8220;<em>code .<\/em>&#8221; komutu ile <em>Visual Studio Code<\/em> i\u00e7erisinde projenin a\u00e7\u0131lmas\u0131n\u0131 sa\u011flayal\u0131m.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1493 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell.jpg\" alt=\"\" width=\"1624\" height=\"699\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell.jpg 1624w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell-300x129.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell-768x331.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/aspnetcore-powershell-1024x441.jpg 1024w\" data-sizes=\"(max-width: 1624px) 100vw, 1624px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1624px; --smush-placeholder-aspect-ratio: 1624\/699;\" \/><\/a><\/p>\n<p>Bu i\u015flemin ard\u0131ndan template, a\u015fa\u011f\u0131daki gibi <em>Visual Studio Code<\/em> i\u00e7erisinde a\u00e7\u0131lacakt\u0131r.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/visualstudiocode.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1494 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/visualstudiocode.jpg\" alt=\"\" width=\"1777\" height=\"618\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/visualstudiocode.jpg 1777w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/visualstudiocode-300x104.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/visualstudiocode-768x267.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/visualstudiocode-1024x356.jpg 1024w\" data-sizes=\"(max-width: 1777px) 100vw, 1777px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1777px; --smush-placeholder-aspect-ratio: 1777\/618;\" \/><\/a><\/p>\n<p>Art\u0131k kodlamaya yava\u015f yava\u015f ba\u015flayabiliriz.<\/p>\n<h5>Model Tan\u0131mlama<\/h5>\n<p>Bir e-ticaret sitesi geli\u015ftirdi\u011fimizi d\u00fc\u015f\u00fcnelim ve \u00fcr\u00fcnlerimizi y\u00f6netecek bir RESTful API tasarlamak istiyoruz. \u00d6ncelikle proje i\u00e7erisinde &#8220;<em>Models<\/em>&#8221; isminde bir folder olu\u015ftural\u0131m ve i\u00e7erisine &#8220;<em>Product<\/em>&#8221; class&#8217;\u0131n\u0131 a\u015fa\u011f\u0131daki gibi tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Models\r\n{\r\n    public class Product\r\n    {\r\n        public long Id { get; set; }\r\n        public long CategoryId { get; set; }\r\n\r\n        public string Name { get; set; }\r\n        public string Description { get; set; }\r\n        public double Price { get; set; }\r\n        public DateTime CreatedDate { get; set; }\r\n    }\r\n}<\/pre>\n<p>Sql create script&#8217;i ise:<\/p>\n<pre class=\"lang:tsql decode:true\">USE [RESTfulSampleDb]\r\nGO\r\n\r\nCREATE TABLE [dbo].[Products](\r\n\t[Id] [bigint] IDENTITY(1,1) NOT NULL,\r\n\t[CategoryId] [bigint] NULL,\r\n\t[Name] [nvarchar](50) NOT NULL,\r\n\t[Description] [nvarchar](max) NOT NULL,\r\n\t[Price] [decimal](18, 2) NOT NULL,\r\n\t[CreatedDate] [datetime2] NOT NULL,\r\n CONSTRAINT [PK_Products] PRIMARY KEY CLUSTERED \r\n(\r\n\t[Id] ASC\r\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\r\n) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]<\/pre>\n<h5>Contract Tan\u0131mlama<\/h5>\n<p><strong>Request<\/strong> ve <strong>Response<\/strong> objelerini tan\u0131mlayabilmek i\u00e7in &#8220;<em>Contracts<\/em>&#8221; isminde yeni bir folder daha olu\u015ftural\u0131m. API \u00fczerinden sisteme yeni bir product eklenmek istenece\u011fi zaman kullanacak olaca\u011f\u0131m\u0131z &#8220;<em>ProductRequest<\/em>&#8221; objesini a\u015fa\u011f\u0131daki gibi tan\u0131ml\u0131 olsun.<\/p>\n<pre class=\"lang:c# decode:true \">using System;\r\nusing System.Collections.Generic;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Contracts\r\n{\r\n    public class ProductRequest\r\n    {\r\n        public long CategoryId { get; set; }\r\n\r\n        public string Name { get; set; }\r\n        public string Description { get; set; }\r\n        public double Price { get; set; }\r\n    }\r\n}<\/pre>\n<p>Bu i\u015flemin ard\u0131ndan, API \u00fczerinden d\u0131\u015far\u0131ya response olarak d\u00f6nece\u011fimiz &#8220;<em>ProductResponse<\/em>&#8221; objesini de a\u015fa\u011f\u0131daki gibi tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\nusing Newtonsoft.Json;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Contracts\r\n{\r\n    public class ProductResponse\r\n    {\r\n        public ProductResponse()\r\n        {  \r\n             Products = new List&lt;Product&gt;();\r\n        }\r\n\r\n        [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]\r\n        public string Message { get; set; }\r\n\r\n        public List&lt;Product&gt; Products { get; set; }\r\n    }\r\n}<\/pre>\n<p>Buradaki &#8220;<em>Message<\/em>&#8221; property&#8217;sini istenilen product&#8217;\u0131n bulunamad\u0131\u011f\u0131 durumlarda, bulunamad\u0131 bilgisini response olarak d\u00f6nebilmek i\u00e7in kullanaca\u011f\u0131z. E\u011fer &#8220;<em>Message<\/em>&#8221; property&#8217;sine\u00a0herhangi bir bilgi set etmez isek, eklemi\u015f oldu\u011fumuz &#8220;<em>[JsonProperty]<\/em>&#8221; attribute&#8217;\u00fc ile serialize i\u015flemleri s\u0131ras\u0131nda bu property, ignore edilecektir.<\/p>\n<h5>Controller&#8217;\u0131 Olu\u015fturma<\/h5>\n<p>Gerekli olan common objeleri tan\u0131mlamam\u0131z\u0131n ard\u0131ndan, art\u0131k s\u0131ras\u0131yla &#8220;Controller &gt; Business &gt; Data&#8221; \u015feklinde kodlamaya ve implemente etmeye ba\u015flayabiliriz. \u0130lk olarak &#8220;<em>Controllers<\/em>&#8221; folder&#8217;\u0131 i\u00e7erisinde, &#8220;<em>ProductsController<\/em>&#8221; isminde yeni bir controller olu\u015ftural\u0131m ve a\u015fa\u011f\u0131daki gibi kodlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing aspnetcore_rest_api_with_dapper.Business;\r\nusing aspnetcore_rest_api_with_dapper.Contracts;\r\nusing aspnetcore_rest_api_with_dapper.Data;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\nusing Microsoft.AspNetCore.Mvc;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Controllers\r\n{\r\n    [Route(\"api\/v1\/[controller]\")]\r\n    public class ProductsController : Controller\r\n    {\r\n        private readonly IProductBusiness _productBusiness;\r\n\r\n        public ProductsController(IProductBusiness productBusiness)\r\n        {\r\n            _productBusiness = productBusiness;\r\n        }\r\n\r\n        \/\/ GET api\/v1\/products\/{id}\r\n        [HttpGet(\"{id}\")]\r\n        public async Task&lt;ProductResponse&gt; Get(long id)\r\n        {\r\n            return await _productBusiness.GetAsync(id);\r\n        }\r\n\r\n        \/\/ GET api\/v1\/products\r\n        [HttpGet]\r\n        public async Task&lt;ProductResponse&gt; Get()\r\n        {\r\n            return await _productBusiness.GetAllAsync();\r\n        }\r\n\r\n        \/\/ POST api\/v1\/products\r\n        [ProducesResponseType(201)]\r\n        [HttpPost]\r\n        public async Task Post([FromBody]ProductRequest productRequest)\r\n        {\r\n            await _productBusiness.AddAsync(productRequest);\r\n        }\r\n    }\r\n}<\/pre>\n<p>Constructor \u00fczerinden &#8220;<em>IProductBusiness<\/em>&#8221; olarak bir interface inject ettik ve ard\u0131ndan &#8220;<em>GetAsync<\/em>&#8220;, &#8220;<em>GetAllAsync<\/em>&#8221; ve &#8220;<em>AddAsync<\/em>&#8221; method&#8217;lar\u0131n\u0131n implementasyonunu, s\u0131ras\u0131yla ger\u00e7ekle\u015ftirdik.\u00a0Bu noktadan itibaren daha iyi bir sistem performans\u0131 elde edebilmek i\u00e7in, task-based olarak ilerleyece\u011fiz.<\/p>\n<p>\u0130leride versiyonlama i\u015flemlerini yapabilmek i\u00e7in ise, URL path&#8217;i &#8220;<em>api\/v1\/products<\/em>&#8221; \u015feklinde tan\u0131mlad\u0131k.<\/p>\n<h5>Business&#8217;\u0131 Olu\u015fturma<\/h5>\n<p>Controller&#8217;\u0131 kodlarken &#8220;<em>IProductBusiness<\/em>&#8221; interface&#8217;ini kullanm\u0131\u015ft\u0131k. \u015eimdi &#8220;<em>Business<\/em>&#8221; isminde bir folder olu\u015fturarak, i\u00e7erisinde a\u015fa\u011f\u0131daki gibi &#8220;<em>IProductBusiness<\/em>&#8221; interface&#8217;ini tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Threading.Tasks;\r\nusing aspnetcore_rest_api_with_dapper.Contracts;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Business\r\n{\r\n    public interface IProductBusiness\r\n    {\r\n        Task&lt;ProductResponse&gt; GetAsync(long id);\r\n        Task&lt;ProductResponse&gt; GetAllAsync();\r\n        Task AddAsync(ProductRequest productRequest);\r\n    }\r\n}<\/pre>\n<p>Buradaki Get method&#8217;lar\u0131nda response olarak, tan\u0131mlad\u0131\u011f\u0131m\u0131z &#8220;<em>ProductResponse<\/em>&#8221; class&#8217;\u0131n\u0131\u00a0kullanaca\u011f\u0131z. \u015eimdi &#8220;<em>ProductBusiness<\/em>&#8221; isminde bir class olu\u015ftural\u0131m ve &#8220;<em>IProductBusiness<\/em>&#8221; interface&#8217;ini a\u015fa\u011f\u0131daki gibi implemente edelim.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing aspnetcore_rest_api_with_dapper.Contracts;\r\nusing aspnetcore_rest_api_with_dapper.Data;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Business\r\n{\r\n    public class ProductBusiness : IProductBusiness\r\n    {\r\n        private readonly IProductRepository _productRepository;\r\n\r\n        public ProductBusiness(IProductRepository productRepository)\r\n        {\r\n            _productRepository = productRepository;\r\n        }\r\n\r\n        public async Task&lt;ProductResponse&gt; GetAsync(long id)\r\n        {\r\n            ProductResponse productResponse = new ProductResponse();\r\n            var product = await _productRepository.GetAsync(id);\r\n\r\n            if(product == null)\r\n            {\r\n                productResponse.Message = \"Product not found.\";\r\n            }\r\n            else\r\n            {\r\n                productResponse.Products.Add(product);\r\n            }\r\n\r\n            return productResponse;\r\n        }\r\n\r\n        public async Task&lt;ProductResponse&gt; GetAllAsync()\r\n        {\r\n            \/\/TODO: Paging...\r\n\r\n            ProductResponse productResponse = new ProductResponse();\r\n            IEnumerable&lt;Product&gt; products = await _productRepository.GetAllAsync();\r\n            \r\n            if(products.ToList().Count == 0)\r\n            {\r\n                productResponse.Message = \"Products not found.\";\r\n            }\r\n            else\r\n            {\r\n                productResponse.Products.AddRange(products);\r\n            }\r\n\r\n            return productResponse;\r\n        }\r\n\r\n        public async Task AddAsync(ProductRequest productRequest)\r\n        {\r\n            Product product = new Product(){\r\n                CategoryId = productRequest.CategoryId,\r\n                Name = productRequest.Name,\r\n                Description = productRequest.Description,\r\n                Price = productRequest.Price\r\n            };\r\n\r\n            await _productRepository.AddAsync(product);\r\n        }\r\n    }\r\n}<\/pre>\n<p>Bu noktada ise constructor \u00fczerinden bir &#8220;<em>IProductRepository<\/em>&#8221; inject ediyoruz. Controller i\u00e7erisinde oldu\u011fu gibi bu interface&#8217;in de &#8220;<em>GetAsync<\/em>&#8220;, &#8220;<em>GetAllAsync<\/em>&#8221; ve &#8220;<em>AddAsync<\/em>&#8221; method&#8217;lar\u0131n\u0131 yukar\u0131daki gibi implemente ediyoruz.<\/p>\n<blockquote><p><strong>NOT<\/strong>: &#8220;<em>GetAllAsync<\/em>&#8221; method&#8217;unu implemente ederken, paging i\u015flemini ger\u00e7ekle\u015ftirmedik. Es ge\u00e7meyelim. :)<\/p><\/blockquote>\n<h5>Data K\u0131sm\u0131n\u0131n Olu\u015fturulmas\u0131<\/h5>\n<p>Data i\u015flemlerini ger\u00e7ekle\u015ftirebilmek i\u00e7in burada, <strong>Repository<\/strong> pattern&#8217;\u0131 ve <strong>Dapper<\/strong>&#8216;\u0131 kullanaca\u011f\u0131m\u0131z\u0131 belirtmi\u015ftik. Bunun i\u00e7in \u00f6ncelikle a\u015fa\u011f\u0131daki gibi Dapper&#8217;\u0131, projemize\u00a0nuget \u00fczerinden dahil edelim.<\/p>\n<pre class=\"lang:c# decode:true\">dotnet add package Dapper<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/dapper-added.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1508 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/dapper-added.jpg\" alt=\"\" width=\"1861\" height=\"835\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/dapper-added.jpg 1861w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/dapper-added-300x135.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/dapper-added-768x345.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/dapper-added-1024x459.jpg 1024w\" data-sizes=\"(max-width: 1861px) 100vw, 1861px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1861px; --smush-placeholder-aspect-ratio: 1861\/835;\" \/><\/a><\/p>\n<p>Dapper&#8217;\u0131n projeye dahil edilmesinden sonra, &#8220;<em>Data<\/em>&#8221; isminde yeni bir folder olu\u015ftural\u0131m ve i\u00e7erisinde ilk olarak &#8220;<em>IProductRepository<\/em>&#8221; interface&#8217;ini a\u015fa\u011f\u0131daki gibi tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Threading.Tasks;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Data\r\n{\r\n    public interface IProductRepository\r\n    {\r\n        Task&lt;Product&gt; GetAsync(long id);\r\n        Task&lt;IEnumerable&lt;Product&gt;&gt; GetAllAsync();\r\n        Task AddAsync(Product product);\r\n    }\r\n}<\/pre>\n<p>Burada sadece \u00f6rne\u011fimiz gere\u011fi baz\u0131 method&#8217;lar\u0131 tan\u0131mlayaca\u011f\u0131z. Bunlar ise &#8220;<em>IProductBusiness<\/em>&#8221; i\u00e7erisinde kullanm\u0131\u015f oldu\u011fumuz &#8220;<em>GetAsync<\/em>&#8220;, &#8220;<em>GetAllAsync<\/em>&#8221; ve &#8220;<em>AddAsync<\/em>&#8221; method&#8217;lar\u0131 olacak. Implemente edebilmek i\u00e7in &#8220;<em>ProductRepository<\/em>&#8221; isminde yeni bir class tan\u0131mlayal\u0131m ve a\u015fa\u011f\u0131daki gibi kodlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Data;\r\nusing System.Data.SqlClient;\r\nusing System.Threading.Tasks;\r\nusing aspnetcore_rest_api_with_dapper.Models;\r\nusing Dapper;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Data\r\n{\r\n    public class ProductRepository : IProductRepository\r\n    {\r\n        private readonly string _connectionString;\r\n        private  IDbConnection _connection { get { return new SqlConnection(_connectionString); }}\r\n\r\n        public ProductRepository()\r\n        {\r\n            \/\/ TODO: It will be refactored...\r\n            _connectionString = \"Server=DESKTOP-85SV1TI\\\\SQLEXPRESS;Database=RESTfulSampleDb;Trusted_Connection=True;MultipleActiveResultSets=true\";\r\n        }\r\n\r\n        public async Task&lt;Product&gt; GetAsync(long id)\r\n        {\r\n            using (IDbConnection dbConnection = _connection)\r\n            {\r\n                string query = @\"SELECT [Id] ,[CategoryId]\r\n                                ,[Name]\r\n                                ,[Description]\r\n                                ,[Price]\r\n                                ,[CreatedDate]\r\n                                FROM [dbo].[Products]\r\n                                WHERE [Id] = @Id\";\r\n\r\n                var product = await dbConnection.QueryFirstOrDefaultAsync&lt;Product&gt;(query, new{ @Id = id });\r\n\r\n                return product;\r\n            }\r\n        }\r\n        public async Task&lt;IEnumerable&lt;Product&gt;&gt; GetAllAsync()\r\n        {\r\n            \/\/TODO: Paging...\r\n            using (IDbConnection dbConnection = _connection)\r\n            {\r\n                string query = @\"SELECT [Id] ,[CategoryId]\r\n                                ,[Name]\r\n                                ,[Description]\r\n                                ,[Price]\r\n                                ,[CreatedDate]\r\n                                FROM [dbo].[Products]\";\r\n\r\n                var product = await dbConnection.QueryAsync&lt;Product&gt;(query);\r\n\r\n                return product;\r\n            }\r\n        }\r\n\r\n        public async Task AddAsync(Product product)\r\n        {\r\n            using (IDbConnection dbConnection = _connection)\r\n            {\r\n                string query = @\"INSERT INTO [dbo].[Products] (\r\n                                [Id],\r\n                                [CategoryId],\r\n                                [Name],\r\n                                [Description],\r\n                                [Price],\r\n                                [CreatedDate]) VALUES (\r\n                                @Id,\r\n                                @CategoryId,\r\n                                @Name,\r\n                                @Description,\r\n                                @Price,\r\n                                @CreatedDate)\";\r\n\r\n                await dbConnection.ExecuteAsync(query, product);\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Kodlama s\u0131ras\u0131nda dikkat ederseniz e\u011fer, Dapper&#8217;\u0131n async method&#8217;lar\u0131n\u0131 kullanmaya \u00e7al\u0131\u015ft\u0131k. Buraya kadar olan noktada, &#8220;<em>Controller<\/em>&#8220;, &#8220;<em>Business<\/em>&#8221; ve &#8220;<em>Data<\/em>&#8221; i\u015flemlerini tamamlad\u0131k.<\/p>\n<h5>Global Exception Handling with Serilog<\/h5>\n<p>Bu noktada exception handling konusunda bir ka\u00e7 farkl\u0131 alternatifimiz var. \u0130ster <strong>middleware<\/strong>&#8216;i tercih edebiliriz, istersek de MVC\u00a0<strong>exception filters<\/strong>\u00a0attribute&#8217;\u00fcn\u00fc. Ben bu noktada, middleware&#8217;i kullanmay\u0131 tercih edece\u011fim. \u00c7\u00fcnk\u00fc general case&#8217;ler kar\u015f\u0131s\u0131nda MVC exception filter&#8217;lar\u0131n\u0131n, yeterince flexible olmad\u0131\u011f\u0131 s\u00f6yleniyor.<\/p>\n<p>Bunun i\u00e7in nuget \u00fczerinden Serilog&#8217;un file logger&#8217;\u0131n\u0131, projemize a\u015fa\u011f\u0131daki gibi dahil edelim.<\/p>\n<pre class=\"lang:c# decode:true\">dotnet add package Serilog.Extensions.Logging.File<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/serilog-added.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1510 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/serilog-added.jpg\" alt=\"\" width=\"1869\" height=\"617\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/serilog-added.jpg 1869w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/serilog-added-300x99.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/serilog-added-768x254.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/serilog-added-1024x338.jpg 1024w\" data-sizes=\"(max-width: 1869px) 100vw, 1869px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1869px; --smush-placeholder-aspect-ratio: 1869\/617;\" \/><\/a><\/p>\n<p>Implementasyon i\u00e7in &#8220;<em>Middlewares<\/em>&#8221; isminde yeni bir folder olu\u015ftural\u0131m ve i\u00e7erisinde a\u015fa\u011f\u0131daki gibi &#8220;<em>GlobalExceptionMiddleware<\/em>&#8221; isminde bir class tan\u0131mlayal\u0131m.<\/p>\n<pre class=\"lang:c# decode:true \">using System;\r\nusing System.Threading.Tasks;\r\nusing Microsoft.AspNetCore.Http;\r\nusing Microsoft.Extensions.Logging;\r\n\r\nnamespace aspnetcore_rest_api_with_dapper.Middlewares\r\n{\r\n    public class GlobalExceptionMiddleware\r\n    {\r\n        private readonly ILogger _logger;\r\n        private readonly RequestDelegate _next;\r\n\r\n        public GlobalExceptionMiddleware(RequestDelegate next, ILoggerFactory logger)\r\n        {\r\n            _next = next;\r\n            _logger = logger.CreateLogger(\"GlobalExceptionMiddleware\");\r\n        }\r\n\r\n        public async Task Invoke(HttpContext context)\r\n        {\r\n            try\r\n            {\r\n                await _next(context);\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                 _logger.LogError(0, ex, ex.Message);\r\n            }\r\n        }\r\n    }\r\n}<\/pre>\n<p>Middleware i\u00e7erisinden exception&#8217;lar\u0131, yukar\u0131daki gibi basit bir \u015fekilde handle ettik. \u015eimdi tek yapmam\u0131z gereken \u015fey &#8220;<em>Startup.cs<\/em>&#8221; i\u00e7erisinden a\u015fa\u011f\u0131daki gibi log file path&#8217;ini belirtmek\u00a0ve middleware i\u00e7erisine dahil etmek olacakt\u0131r.<\/p>\n<pre class=\"lang:c# mark:3,5 decode:true \">public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n{\r\n    loggerFactory.AddFile(\"C:\/@Logs\/aspnetcore-rest-api-with-dapper-{Date}.txt\");\r\n\r\n    app.UseMiddleware(typeof(GlobalExceptionMiddleware));\r\n    app.UseMvc();\r\n}<\/pre>\n<h5>Swagger Implementasyonu<\/h5>\n<p>API&#8217;\u0131n consume i\u015flemleri s\u0131ras\u0131nda biz developer&#8217;lara \u00e7ok fazla kolayl\u0131k sa\u011flayan Swagger&#8217;\u0131n implementasyon i\u015flemini ger\u00e7ekle\u015ftirebilmek i\u00e7in, \u00f6ncelikle nuget \u00fczerinden projemize a\u015fa\u011f\u0131daki gibi dahil etmemiz gerekmektedir.<\/p>\n<pre class=\"lang:c# decode:true\">dotnet add package Swashbuckle.AspNetCore<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/swagger-added.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1511 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/swagger-added.jpg\" alt=\"\" width=\"1850\" height=\"593\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-added.jpg 1850w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-added-300x96.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-added-768x246.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-added-1024x328.jpg 1024w\" data-sizes=\"(max-width: 1850px) 100vw, 1850px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1850px; --smush-placeholder-aspect-ratio: 1850\/593;\" \/><\/a><\/p>\n<p>\u015eimdi ise &#8220;Startup.cs&#8221; i\u00e7erisinden, Swagger&#8217;\u0131 a\u015fa\u011f\u0131daki gibi aktif hale getirelim.<\/p>\n<pre class=\"lang:c# mark:4-7,18,21-24 decode:true\">public void ConfigureServices(IServiceCollection services)\r\n{\r\n    \/\/ Register the Swagger generator, defining one or more Swagger documents\r\n    services.AddSwaggerGen(c =&gt;\r\n    {\r\n        c.SwaggerDoc(\"v1\", new Info { Title = \"ASP.NET Core RESTful API\", Version = \"v1\" });\r\n    });\r\n}\r\n\r\npublic void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)\r\n{\r\n    loggerFactory.AddFile(\"C:\/@Logs\/aspnetcore-rest-api-with-dapper-{Date}.txt\");\r\n\r\n    app.UseMiddleware(typeof(GlobalExceptionMiddleware));\r\n    app.UseMvc();\r\n\r\n    \/\/ Enable middleware to serve generated Swagger as a JSON endpoint.\r\n    app.UseSwagger();\r\n\r\n    \/\/ Enable middleware to serve swagger-ui (HTML, JS, CSS etc.), specifying the Swagger JSON endpoint.\r\n    app.UseSwaggerUI(c =&gt;\r\n    {\r\n        c.SwaggerEndpoint(\"\/swagger\/v1\/swagger.json\", \"ASP.NET Core RESTful API v1\");\r\n    });\r\n}<\/pre>\n<p>Projeyi \u00e7al\u0131\u015ft\u0131rd\u0131ktan sonra tek yapmam\u0131z gereken \u015fey art\u0131k, &#8220;<em>http:\/\/localhost:5000\/swagger<\/em>&#8221; URL&#8217;\u0131 \u00fczerinden eri\u015fmek olacakt\u0131r.<\/p>\n<h5>Application Service&#8217;lerin Inject Edilmesi<\/h5>\n<p>Hat\u0131rlarsak b\u00f6l\u00fcm\u00fcn ba\u015f\u0131nda &#8220;<em>IProductBusiness<\/em>&#8221; ve &#8220;<em>IProductRepository<\/em>&#8221; interface&#8217;lerini, constructor&#8217;lar \u00fczerinden inject ederek kullanm\u0131\u015ft\u0131k. Resolve i\u015flemlerinin ger\u00e7ekle\u015febilmesi i\u00e7in &#8220;Startup.cs&#8221; i\u00e7erisinden, application service&#8217;ler aras\u0131na ilgili type&#8217;lar\u0131 tan\u0131mlamam\u0131z gerekmektedir.<\/p>\n<p>Bunun i\u00e7in:<\/p>\n<pre class=\"lang:c# mark:7-8 decode:true \">public void ConfigureServices(IServiceCollection services)\r\n{\r\n    \/\/ Add framework services.\r\n    services.AddMvc();\r\n\r\n    \/\/ Add application services.\r\n    services.AddTransient&lt;IProductBusiness, ProductBusiness&gt;();\r\n    services.AddTransient&lt;IProductRepository, ProductRepository&gt;();\r\n\r\n    \/\/ Register the Swagger generator, defining one or more Swagger documents\r\n    services.AddSwaggerGen(c =&gt;\r\n    {\r\n        c.SwaggerDoc(\"v1\", new Info { Title = \"ASP.NET Core RESTful API\", Version = \"v1\" });\r\n    });\r\n}<\/pre>\n<p>Art\u0131k projemiz tamamen haz\u0131r durumda.<\/p>\n<p>Terminal \u00fczerinden &#8220;<em>dotnet build<\/em>&#8221; yazarak kodu derleyelim ve ard\u0131ndan &#8220;<em>dotnet run<\/em>&#8221; komutu ile <strong>Kestrel<\/strong> vas\u0131tas\u0131yla projeyi \u00e7al\u0131\u015ft\u0131rabiliriz.<\/p>\n<p>\u00c7al\u0131\u015ft\u0131rd\u0131ktan sonra Swagger&#8217;a,\u00a0&#8220;<em>http:\/\/localhost:5000\/swagger<\/em>&#8221; URI&#8217;\u0131 \u00fczerinden eri\u015febiliriz.<\/p>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/swagger-ui.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1522 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/swagger-ui.jpg\" alt=\"\" width=\"1749\" height=\"1423\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-ui.jpg 1749w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-ui-300x244.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-ui-768x625.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/swagger-ui-1024x833.jpg 1024w\" data-sizes=\"(max-width: 1749px) 100vw, 1749px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1749px; --smush-placeholder-aspect-ratio: 1749\/1423;\" \/><\/a><\/p>\n<h5>Azure App Services&#8217;e Deploy \u0130\u015flemi<\/h5>\n<p>Bunun i\u00e7in \u00f6ncelikle a\u015fa\u011f\u0131daki ad\u0131mlar\u0131 s\u0131ras\u0131yla uygulamam\u0131z gerekmektedir.<\/p>\n<ol>\n<li><em><a href=\"https:\/\/portal.azure.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Azure portal<\/a><\/em> \u00fczerine login olal\u0131m.<\/li>\n<li>Sol \u00fcst men\u00fcden &#8220;<strong><em>New<\/em><\/strong>&#8221; k\u0131sm\u0131na t\u0131klayal\u0131m.<\/li>\n<li>A\u00e7\u0131lan men\u00fcden a\u015fa\u011f\u0131daki gibi &#8220;<em><strong>Web + Mobile<\/strong> &gt; <strong>Web App<\/strong><\/em>&#8221; k\u0131sm\u0131n\u0131 se\u00e7elim.<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/azure-web-app.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1524 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/azure-web-app.jpg\" alt=\"\" width=\"1209\" height=\"841\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-web-app.jpg 1209w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-web-app-300x209.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-web-app-768x534.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-web-app-1024x712.jpg 1024w\" data-sizes=\"(max-width: 1209px) 100vw, 1209px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1209px; --smush-placeholder-aspect-ratio: 1209\/841;\" \/><\/a><\/li>\n<li>E\u011fer subscription yoksa, a\u00e7\u0131lacak ekran \u00fczerinden &#8220;<em>Sign up for a new subscription<\/em>&#8221; k\u0131sm\u0131na gelerek, bir ayl\u0131k deneme s\u00fcr\u00fcm\u00fcn\u00fc elde edelim.<\/li>\n<li>&#8220;<em>Name<\/em>&#8221; k\u0131sm\u0131na uygulamam\u0131z\u0131n ad\u0131n\u0131 <strong>unique<\/strong> olacak \u015fekilde belirlememiz gerekmektedir. Ben burada a\u015fa\u011f\u0131daki gibi &#8220;<em>AspNetCoreRestfulApiSampleGokhanGokalp<\/em>&#8221; olarak ayarl\u0131yorum ve <strong>create<\/strong> butonuna bas\u0131yorum. (Bu i\u015flem biraz vakit alacakt\u0131r.)<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/webapp-azure-create.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1526 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/webapp-azure-create.jpg\" alt=\"\" width=\"657\" height=\"933\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/webapp-azure-create.jpg 657w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/webapp-azure-create-211x300.jpg 211w\" data-sizes=\"(max-width: 657px) 100vw, 657px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 657px; --smush-placeholder-aspect-ratio: 657\/933;\" \/><\/a><\/li>\n<li>Create butonuna bast\u0131ktan sonra deployment i\u015flemi\u00a0bitti\u011finde, &#8220;<em>Deployments succeeded<\/em>&#8221; \u015feklinde bir bildirim alaca\u011f\u0131z ve a\u015fa\u011f\u0131daki gibi bir ekran g\u00f6r\u00fcyor olmal\u0131y\u0131z.<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/azure-deployment.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1527 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/azure-deployment.jpg\" alt=\"\" width=\"1887\" height=\"1115\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-deployment.jpg 1887w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-deployment-300x177.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-deployment-768x454.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-deployment-1024x605.jpg 1024w\" data-sizes=\"(max-width: 1887px) 100vw, 1887px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1887px; --smush-placeholder-aspect-ratio: 1887\/1115;\" \/><\/a><\/li>\n<li>\u015eimdi sol men\u00fcde bulunan &#8220;<em>Deployment options<\/em>&#8221; k\u0131sm\u0131na girelim ve &#8220;<em>Local Git Repository<\/em>&#8221; k\u0131sm\u0131na t\u0131klayal\u0131m.<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/local-git-repository.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1528 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/local-git-repository.jpg\" alt=\"\" width=\"1201\" height=\"813\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/local-git-repository.jpg 1201w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/local-git-repository-300x203.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/local-git-repository-768x520.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/local-git-repository-1024x693.jpg 1024w\" data-sizes=\"(max-width: 1201px) 100vw, 1201px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1201px; --smush-placeholder-aspect-ratio: 1201\/813;\" \/><\/a><\/li>\n<li>Daha sonra\u00a0basic authentication i\u015flemi i\u00e7in &#8220;<em>Deployment user name<\/em>&#8221; ve &#8220;<em>Password<\/em>&#8221; belirleyelim.<\/li>\n<li>\u015eimdi\u00a0sol men\u00fcden &#8220;<em><strong>Settings<\/strong> <\/em>&gt; <em><strong>Properties<\/strong><\/em>&#8221; k\u0131sm\u0131na girelim ve orada yer alan &#8220;<em>GIT URL<\/em>&#8221; k\u0131sm\u0131n\u0131 kopyalayal\u0131m.<br \/>\n<a href=\"\/wp-content\/uploads\/2017\/06\/azure-git-url.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1529 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/azure-git-url.jpg\" alt=\"\" width=\"1081\" height=\"459\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-git-url.jpg 1081w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-git-url-300x127.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-git-url-768x326.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/azure-git-url-1024x435.jpg 1024w\" data-sizes=\"(max-width: 1081px) 100vw, 1081px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1081px; --smush-placeholder-aspect-ratio: 1081\/459;\" \/><\/a><\/li>\n<\/ol>\n<p>Art\u0131k projeyi <em>Azure App Service<\/em> \u00fczerine publish etmek i\u00e7in haz\u0131r\u0131z.<\/p>\n<p>\u00d6ncelikle bunun i\u00e7in <em>Visual Studio Code<\/em> \u00fczerinden bir local Git repository olu\u015fturmam\u0131z gerekiyor.<\/p>\n<p>Sol men\u00fcden &#8220;<em>Source Control<\/em>&#8221; men\u00fcs\u00fcne geldikten sonra, &#8220;<em>Initialize git repository<\/em>&#8221; k\u0131sm\u0131na t\u0131klayal\u0131m ve ard\u0131ndan &#8220;<em>Commit All<\/em>&#8221; butonuna basal\u0131m.<a href=\"\/wp-content\/uploads\/2017\/06\/git-icon.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1530 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/git-icon.png\" alt=\"\" width=\"304\" height=\"215\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-icon.png 304w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-icon-300x212.png 300w\" data-sizes=\"(max-width: 304px) 100vw, 304px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 304px; --smush-placeholder-aspect-ratio: 304\/215;\" \/><\/a><\/p>\n<p>Daha sonra a\u015fa\u011f\u0131daki komutu terminal \u00fczerinden \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:c# decode:true \">git remote add azure [URL for remote repository]<\/pre>\n<p>\u015eimdide credential bilgilerinin push i\u015flemlerinde otomatik eklenebilmesi i\u00e7in, a\u015fa\u011f\u0131daki komutu \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<pre class=\"lang:c# decode:true\">git config credential.helper store<\/pre>\n<p>Art\u0131k push i\u015flemini ger\u00e7ekle\u015ftirebiliriz. Bunun i\u00e7in a\u015fa\u011f\u0131daki komutu kullanabiliriz:<\/p>\n<pre class=\"lang:c# decode:true \">git push -u azure master<\/pre>\n<p><a href=\"\/wp-content\/uploads\/2017\/06\/git-push.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-1531 lazyload\" data-src=\"\/wp-content\/uploads\/2017\/06\/git-push.jpg\" alt=\"\" width=\"1860\" height=\"617\" data-srcset=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-push.jpg 1860w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-push-300x100.jpg 300w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-push-768x255.jpg 768w, https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/git-push-1024x340.jpg 1024w\" data-sizes=\"(max-width: 1860px) 100vw, 1860px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1860px; --smush-placeholder-aspect-ratio: 1860\/617;\" \/><\/a><\/p>\n<p>T\u00fcm i\u015flemlerin bitiminin ard\u0131ndan ise, a\u015fa\u011f\u0131daki gibi bir ka\u00e7 sat\u0131r g\u00f6r\u00fcyor olaca\u011f\u0131z.<\/p>\n<pre class=\"lang:default decode:true\">remote: Finished successfully.\r\nremote: Running post deployment command(s)...\r\nremote: Deployment successful.\r\nTo https:\/\/aspnetcorerestfulapisamplegokhangokalp.scm.azurewebsites.net:443\/AspNetCoreRestfulApiSampleGokhanGokalp.git\r\n * [new branch]      master -&gt; master<\/pre>\n<p>\u0130\u015fte bu kadar. Azure App Services \u00fczerinde host etmi\u015f oldu\u011fumuz projeye art\u0131k, buradan eri\u015fim sa\u011flayabilirsiniz:\u00a0<em><a href=\"http:\/\/aspnetcorerestfulapisamplegokhangokalp.azurewebsites.net\/swagger\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/aspnetcorerestfulapisamplegokhangokalp.azurewebsites.net\/swagger\/<\/a><\/em><\/p>\n<p>Umar\u0131m herkes i\u00e7in keyifli bir makale olmu\u015ftur. ASP.NET Core, g\u00fcn ge\u00e7tik\u00e7e dahada harika bir hal alarak ilerlemeye devam ediyor. Bir sonraki ASP.NET Core makale serisinde, g\u00f6r\u00fc\u015fmek \u00fczere.<\/p>\n<p><em><a href=\"https:\/\/github.com\/GokGokalp\/aspnetcore-rest-api-with-dapper\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/GokGokalp\/aspnetcore-rest-api-with-dapper<\/a><\/em><\/p>\n<h6>Baz\u0131 referanslar:<\/h6>\n<blockquote><p>https:\/\/github.com\/Microsoft\/azure-docs\/blob\/master\/articles\/app-service-web\/web-sites-create-web-app-using-vscode.md<\/p>\n<p>https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/tutorials\/web-api-help-pages-using-swagger<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba arkada\u015flar. ASP.NET Core serisine asl\u0131nda uzun bir s\u00fcredir giri\u015f yapmay\u0131 d\u00fc\u015f\u00fcn\u00fcyordum fakat, bir t\u00fcrl\u00fc f\u0131rsat bulamam\u0131\u015ft\u0131m. :) Son d\u00f6nemlerde do\u011fan baz\u0131 ihtiya\u00e7lar\u0131m\u0131zdan dolay\u0131 (kolayca dockerize edebilmek vb.), bu aralar aktif olarak ASP.NET Core \u00fczerinde development yapmaktay\u0131m. Bu sebep ile ara ara seriler halinde ASP.NET&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#8217;e Deploy<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":1490,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[417,418],"tags":[421,419,423,422,424,420],"class_list":["post-1481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-asp-net-core","category-azure","tag-asp-net-core-restful-api","tag-asp-net-core","tag-asp-net-core-dapper","tag-asp-net-core-deploy-to-azure-web-app-services","tag-asp-net-core-swagger","tag-asp-net-core-web-api","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":true,"content":true,"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 Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#039;e Deploy - 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-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#039;e Deploy - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-16T07:34:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-11T18:58:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"381\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\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=\"24 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-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#8217;e Deploy\",\"datePublished\":\"2017-06-16T07:34:01+00:00\",\"dateModified\":\"2017-12-11T18:58:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/\"},\"wordCount\":2697,\"commentCount\":15,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png\",\"keywords\":[\"asp net core restful api\",\"asp.net core\",\"asp.net core dapper\",\"asp.net core deploy to azure web app services\",\"asp.net core swagger\",\"asp.net core web api\"],\"articleSection\":[\"ASP.NET Core\",\"Azure\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/\",\"name\":\"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services'e Deploy - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png\",\"datePublished\":\"2017-06-16T07:34:01+00:00\",\"dateModified\":\"2017-12-11T18:58:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png\",\"width\":750,\"height\":381},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ASP.NET Core Series 01: Building RESTful API with Dapper and Deploy to Azure App Services\"}]},{\"@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 Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services'e Deploy - 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-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/","og_locale":"tr_TR","og_type":"article","og_title":"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services'e Deploy - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2017-06-16T07:34:01+00:00","article_modified_time":"2017-12-11T18:58:20+00:00","og_image":[{"width":750,"height":381,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png","type":"image\/png"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"24 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services&#8217;e Deploy","datePublished":"2017-06-16T07:34:01+00:00","dateModified":"2017-12-11T18:58:20+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/"},"wordCount":2697,"commentCount":15,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png","keywords":["asp net core restful api","asp.net core","asp.net core dapper","asp.net core deploy to azure web app services","asp.net core swagger","asp.net core web api"],"articleSection":["ASP.NET Core","Azure"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/","url":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/","name":"ASP.NET Core Serisi 01: Dapper ile RESTful API Tasarlama ve Azure App Services'e Deploy - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png","datePublished":"2017-06-16T07:34:01+00:00","dateModified":"2017-12-11T18:58:20+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/06\/ASP.NET-Core-Logo_2colors_Boxed_RGB_bitmap_BIG.png","width":750,"height":381},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/asp-net-core-serisi-01-dapper-ile-restful-api-tasarlama-ve-azure-app-servicese-deploy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"ASP.NET Core Series 01: Building RESTful API with Dapper and Deploy to Azure App Services"}]},{"@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\/1481","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=1481"}],"version-history":[{"count":37,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1481\/revisions"}],"predecessor-version":[{"id":2006,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1481\/revisions\/2006"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/1490"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=1481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=1481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=1481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}