{"id":1852,"date":"2020-04-01T10:15:29","date_gmt":"2020-04-01T08:15:29","guid":{"rendered":"http:\/\/web.evertop.pl\/retrieving-data-from-the-database\/"},"modified":"2021-04-30T11:16:05","modified_gmt":"2021-04-30T09:16:05","slug":"retrieving-data-from-the-database","status":"publish","type":"post","link":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/","title":{"rendered":"Retrieving Data From The Database"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>This is the first article from the series about how to improve your .NET application which uses Entity Framework. I will show you some simple tips that will boost your application. I hope that many advices you will find here can be used in any other ORM or even any other programming language. First of all let\u2019s see how the majority of applications work.<\/p>\n<p><img loading=\"lazy\" class=\"wp-image-1671 size-full aligncenter\" src=\"http:\/\/web.evertop.pl\/wp-content\/uploads\/2020\/09\/01-1-v7HhalmJq29hH4ChRhgJrg.png\" alt=\"\" width=\"483\" height=\"362\" srcset=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/01-1-v7HhalmJq29hH4ChRhgJrg.png 483w, https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/01-1-v7HhalmJq29hH4ChRhgJrg-300x225.png 300w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><br \/>\nFigure 1. Simplified model modern applications<\/p>\n<p>As we can see there are many client (devices) connected to application store in server. The application server communicates with data base server. Application server is a very fast machine prepared to handle many requests from clients and to communicate with a database server. What might be interesting is the fact that for most of the time server waits for the response from a database. The main aim of this series is to reduce and optimize communication between server application and database in order to use them both more efficiently. At the beginning we should start using an asynchronous call to database (and of course any other data source). Then the thread is not held up by waiting for the response but it can start to handle another request.<\/p>\n<h3>Let\u2019s get some data.<\/h3>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-1672 size-full\" src=\"http:\/\/web.evertop.pl\/wp-content\/uploads\/2020\/09\/02-1-OL73qpK5fzPlBWRXfuTmRw.png\" alt=\"\" width=\"685\" height=\"126\" srcset=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/02-1-OL73qpK5fzPlBWRXfuTmRw.png 685w, https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/02-1-OL73qpK5fzPlBWRXfuTmRw-300x55.png 300w\" sizes=\"(max-width: 685px) 100vw, 685px\" \/><\/p>\n<p>Let\u2019s imagine we have to prepare some simple report that informs what kind of bikes are finished and are waiting in a warehouse, with the quantity lower than let\u2019s say 50. We need their names, categories and of course the quantity itself.<\/p>\n<p>First of all we need to create entity models:<\/p>\n<pre>public class Product\r\n{\r\n[Key]\r\npublic int ProductID { get; set; }\r\npublic int ProductSubcategoryID { get; set; }\r\npublic int DaysToManufacture { get; set; }\r\npublic short SafetyStockLevel { get; set; }\r\npublic short ReorderPoint { get; set; }\r\npublic string ProductNumber { get; set; }\r\npublic decimal StandardCost { get; set; }\r\npublic decimal ListPrice { get; set; }\r\npublic string Color { get; set; }\r\npublic string Name { get; set; }\r\npublic bool MakeFlag { get; set; }\r\npublic bool FinishedGoodsFlag { get; set; }\r\npublic DateTime SellStartDate { get; set; }\r\npublic DateTime ModifiedDate { get; set; }\r\npublic ProductSubcategory ProductSubcategory { get; set; }\r\npublic ProductInventory ProductInventory { get; set; }\r\n}public class ProductSubcategory\r\n{\r\n[Key]\r\npublic int ProductSubcategoryID { get; set; }\r\npublic int ProductCategoryID { get; set; }\r\npublic string Name { get; set; }\r\npublic DateTime ModifiedDate { get; set; }\r\npublic ProductCategory ProductCategory { get; set; }\r\npublic ICollection&lt;Product&gt; Products { get; set; }\r\n}public class ProductCategory\r\n{\r\n[Key]\r\npublic int ProductCategoryID { get; set; }\r\npublic string Name { get; set; }\r\npublic Guid rowguid { get; set; }\r\npublic DateTime ModifiedDate { get; set; }\r\n}public class ProductInventory\r\n{\r\npublic int ProductID { get; set; }\r\npublic short LocationID { get; set; }\r\npublic string Shelf { get; set; }\r\npublic byte Bin { get; set; }\r\npublic short Quantity { get; set; }\r\npublic Guid rowguid { get; set; }\r\npublic DateTime ModifiedDate { get; set; }\r\npublic Location Location { get; set; }\r\n}public class Location\r\n{\r\n[Key]\r\npublic short LocationID { get; set; }\r\npublic string Name { get; set; }\r\npublic decimal CostRate { get; set; }\r\npublic decimal Availability { get; set; }\r\npublic DateTime ModifiedDate { get; set; }\r\n}<\/pre>\n<p>Now we can create a database context:<\/p>\n<pre>public class ProdcutionContext : DbContext\r\n{\r\n public DbSet&lt;Product&gt; Product { get; set; }\r\n public DbSet&lt;ProductSubcategory&gt; ProductSubcategory { get; set; }\r\n public DbSet&lt;ProductCategory&gt; ProductCategory { get; set; }\r\n public DbSet&lt;ProductInventory&gt; ProductInventory { get; set; }\r\n public DbSet&lt;Location&gt; Location { get; set; }<span id=\"7071\" class=\"ht fi cq bi hu b du hy hz ia ib ic hw r hx\" data-selectable-paragraph=\"\">protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\r\n {\r\n  optionsBuilder.UseSqlServer(@\"Server=.\\SQLEXPRESS;Database=AdventureWorks2017;\")\r\n  .EnableSensitiveDataLogging(true);\r\n }<\/span>protected override void OnModelCreating(ModelBuilder modelBuilder)\r\n {\r\n  modelBuilder.HasDefaultSchema(\"Production\");\r\n  modelBuilder.Entity&lt;ProductInventory&gt;()\r\n   .HasKey(o =&gt; new { o.LocationID, o.ProductID });\r\n }\r\n}\r\n<\/pre>\n<p>Now we are ready to prepare data:<\/p>\n<pre>using (var context = new ProdcutionContext())\r\n{\r\n var data = await context.Product\r\n  .Include(x =&gt; x.ProductSubcategory)\r\n  .Include(x =&gt; x.ProductSubcategory).ThenInclude(x =&gt; x.ProductCategory)\r\n  .Include(x =&gt; x.ProductInventory)\r\n  .Include(x =&gt; x.ProductInventory).ThenInclude(x =&gt; x.Location)\r\n  .Where(x =&gt; x.ProductSubcategory.ProductCategory.Name.Equals(\"Bikes\"))\r\n  .Where(x =&gt; x.ProductInventory.Location.Name.Equals(\"Finished Goods Storage\"))\r\n  .Where(x =&gt; x.ProductInventory.Quantity &lt; 50)\r\n  .OrderBy(x =&gt; x.ProductSubcategory.Name)\r\n  .ThenBy(x =&gt; x.Name)\r\n  .ThenBy(x =&gt; x.ProductInventory.Quantity)\r\n  .ToListAsync();<span id=\"ba1a\" class=\"ht fi cq bi hu b du hy hz ia ib ic hw r hx\" data-selectable-paragraph=\"\">foreach (var item in data)\r\n {\r\n  Console.WriteLine($\"{item.ProductSubcategory.Name} - {item.Name} - {item.ProductInventory.Quantity}\");\r\n }\r\n}<\/span>\r\n<\/pre>\n<p>After running the program we get:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-1673 size-full\" src=\"http:\/\/web.evertop.pl\/wp-content\/uploads\/2020\/09\/03-1-SDWQRw_CNKoSTRyhZG3rjw.png\" alt=\"\" width=\"384\" height=\"188\" srcset=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/03-1-SDWQRw_CNKoSTRyhZG3rjw.png 384w, https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/03-1-SDWQRw_CNKoSTRyhZG3rjw-300x147.png 300w\" sizes=\"(max-width: 384px) 100vw, 384px\" \/><\/p>\n<p>It looks good, let\u2019s see what has happened in details. To check what was going on I used SQL Server Profiler:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter wp-image-1674 size-full\" src=\"http:\/\/web.evertop.pl\/wp-content\/uploads\/2020\/09\/04-1-O2Ri3iSoBP9ItkcQujt8yg.png\" alt=\"\" width=\"605\" height=\"246\" srcset=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/04-1-O2Ri3iSoBP9ItkcQujt8yg.png 605w, https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/04-1-O2Ri3iSoBP9ItkcQujt8yg-300x122.png 300w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/p>\n<p id=\"510d\" class=\"ft fu cq bi fv b fw hg fy hh ga hi gc hj ge hk gg ci\" data-selectable-paragraph=\"\">Look how much data has been read. This is on of the most important issues which developers forget about when using any ORM. In short, when I ask a developer to prepare the list of all student names using SQL I will probably get something like:<\/p>\n<pre>select firstName from student;<\/pre>\n<p>But If ask about it in ORM like Entity Framework, I would get:<\/p>\n<pre>context.Students.ToList()<\/pre>\n<p>which, of course, gets all columns from the table. In the example above, all the columns from all the tables on the basis of which SQL query is created, are taken from the database.<\/p>\n<h3>Solution<\/h3>\n<p>The best way to fix the problem and reduce the amount of data received from server is to use the projection properly. There are two solutions. One is to use an anonymous class and the other is to prepare a special class. Let\u2019s call it as view model. Both are good. You can use anonymous class when you do not need to pass the data forward. In most cases the best way is to prepare the class as follows:<\/p>\n<pre>public class StockProductViewModel\r\n{\r\n public string Subcategory { get; internal set; }\r\n public string Product { get; internal set; }\r\n public short Quantity { get; internal set; }\r\n}<\/pre>\n<p>Then we can modify our code retrieving data:<\/p>\n<pre>using (var context = new ProdcutionContext())\r\n{\r\n var data = await context.Product\r\n  .Include(x =&gt; x.ProductSubcategory)\r\n  .Include(x =&gt; x.ProductSubcategory).ThenInclude(x =&gt; x.ProductCategory)\r\n  .Include(x =&gt; x.ProductInventory)\r\n  .Include(x =&gt; x.ProductInventory).ThenInclude(x =&gt; x.Location)\r\n  .Where(x =&gt; x.ProductSubcategory.ProductCategory.Name.Equals(\"Bikes\"))\r\n  .Where(x =&gt; x.ProductInventory.Location.Name.Equals(\"Finished Goods Storage\"))\r\n  .Where(x =&gt; x.ProductInventory.Quantity &lt; 50)\r\n  .OrderBy(x =&gt; x.ProductSubcategory.Name)\r\n  .ThenBy(x =&gt; x.Name)\r\n  .ThenBy(x =&gt; x.ProductInventory.Quantity)\r\n  .Select(x =&gt; new StockProductViewModel{\r\n   Subcategory = x.ProductSubcategory.Name,\r\n   Product = x.Name,\r\n   Quantity = x.ProductInventory.Quantity\r\n  })\r\n  .ToListAsync();<span id=\"037e\" class=\"ht fi cq bi hu b du hy hz ia ib ic hw r hx\" data-selectable-paragraph=\"\">foreach (var item in data)\r\n {\r\n  Console.WriteLine($\"{item.Subcategory} - {item.Product} - {item.Quantity}\");\r\n }\r\n}<\/span><\/pre>\n<p>Now we can check which SQL queries are generated when we start our new code:<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1675\" src=\"http:\/\/web.evertop.pl\/wp-content\/uploads\/2020\/09\/05-1-3o1B5RczEOO-9dNu2EIvCg.png\" alt=\"\" width=\"605\" height=\"244\" srcset=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/05-1-3o1B5RczEOO-9dNu2EIvCg.png 605w, https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/09\/05-1-3o1B5RczEOO-9dNu2EIvCg-300x121.png 300w\" sizes=\"(max-width: 605px) 100vw, 605px\" \/><\/p>\n<p>As we can see we get only the data we need. What is worth noticing is that fewer readings were made and it all took less time.<\/p>\n<h3>Summary<\/h3>\n<p>One of the problems with using ORM like Entity Framework is that one forgets about the proper use of projection. When we write a query in SQL we avoid using \u201cselect *\u201c but when we use ORM we forget about not using \u201cselect *\u201d. To avoid the problem we should properly define \u201cSelect\u201d section. In Entity Framework we have two solutions: either to create abstract or concrete classes that define only the fields we need.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This is the first article from the series about how to improve your .NET application which uses Entity Framework. I will show you some simple tips that will boost your application. I hope that many advices you will find here can be used in any other ORM or even any other programming language. First [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":4403,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[60,20],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Retrieving Data From The Database - Evertop<\/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:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Retrieving Data From The Database - Evertop\" \/>\n<meta property=\"og:description\" content=\"Introduction This is the first article from the series about how to improve your .NET application which uses Entity Framework. I will show you some simple tips that will boost your application. I hope that many advices you will find here can be used in any other ORM or even any other programming language. First [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Evertop\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/EvertopPoland\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-01T08:15:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-30T09:16:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1709\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pawe\u0142 Szymura\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.evertop.pl\/#organization\",\"name\":\"Evertop\",\"url\":\"https:\/\/www.evertop.pl\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/EvertopPoland\/\",\"https:\/\/www.linkedin.com\/company\/evertop-software-development\/\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.evertop.pl\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2021\/04\/logo_new.png\",\"contentUrl\":\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2021\/04\/logo_new.png\",\"width\":582,\"height\":114,\"caption\":\"Evertop\"},\"image\":{\"@id\":\"https:\/\/www.evertop.pl\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.evertop.pl\/#website\",\"url\":\"https:\/\/www.evertop.pl\/\",\"name\":\"Evertop\",\"description\":\"we code the future\",\"publisher\":{\"@id\":\"https:\/\/www.evertop.pl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.evertop.pl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg\",\"contentUrl\":\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg\",\"width\":2560,\"height\":1709,\"caption\":\"Cropped image of It specialist working on code\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage\",\"url\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/\",\"name\":\"Retrieving Data From The Database - Evertop\",\"isPartOf\":{\"@id\":\"https:\/\/www.evertop.pl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage\"},\"datePublished\":\"2020-04-01T08:15:29+00:00\",\"dateModified\":\"2021-04-30T09:16:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\\u0142\\u00f3wna\",\"item\":\"https:\/\/www.evertop.pl\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Retrieving Data From The Database\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.evertop.pl\/#\/schema\/person\/67da6133f965ef4876b54ed5cd0509ed\"},\"headline\":\"Retrieving Data From The Database\",\"datePublished\":\"2020-04-01T08:15:29+00:00\",\"dateModified\":\"2021-04-30T09:16:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage\"},\"wordCount\":602,\"publisher\":{\"@id\":\"https:\/\/www.evertop.pl\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg\",\"keywords\":[\"entity framework\",\"programming tips\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.evertop.pl\/#\/schema\/person\/67da6133f965ef4876b54ed5cd0509ed\",\"name\":\"Pawe\\u0142 Szymura\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.evertop.pl\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3c1282144fed3331a59535f2439a6db1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3c1282144fed3331a59535f2439a6db1?s=96&d=mm&r=g\",\"caption\":\"Pawe\\u0142 Szymura\"},\"url\":\"https:\/\/www.evertop.pl\/en\/author\/pszymura\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Retrieving Data From The Database - Evertop","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:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/","og_locale":"en_US","og_type":"article","og_title":"Retrieving Data From The Database - Evertop","og_description":"Introduction This is the first article from the series about how to improve your .NET application which uses Entity Framework. I will show you some simple tips that will boost your application. I hope that many advices you will find here can be used in any other ORM or even any other programming language. First [&hellip;]","og_url":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/","og_site_name":"Evertop","article_publisher":"https:\/\/www.facebook.com\/EvertopPoland\/","article_published_time":"2020-04-01T08:15:29+00:00","article_modified_time":"2021-04-30T09:16:05+00:00","og_image":[{"width":2560,"height":1709,"url":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg","path":"\/home\/evertop\/web-evertop\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg","size":"full","id":4403,"alt":"","pixels":4375040,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pawe\u0142 Szymura","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.evertop.pl\/#organization","name":"Evertop","url":"https:\/\/www.evertop.pl\/","sameAs":["https:\/\/www.facebook.com\/EvertopPoland\/","https:\/\/www.linkedin.com\/company\/evertop-software-development\/"],"logo":{"@type":"ImageObject","@id":"https:\/\/www.evertop.pl\/#logo","inLanguage":"en-US","url":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2021\/04\/logo_new.png","contentUrl":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2021\/04\/logo_new.png","width":582,"height":114,"caption":"Evertop"},"image":{"@id":"https:\/\/www.evertop.pl\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.evertop.pl\/#website","url":"https:\/\/www.evertop.pl\/","name":"Evertop","description":"we code the future","publisher":{"@id":"https:\/\/www.evertop.pl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.evertop.pl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg","contentUrl":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg","width":2560,"height":1709,"caption":"Cropped image of It specialist working on code"},{"@type":"WebPage","@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage","url":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/","name":"Retrieving Data From The Database - Evertop","isPartOf":{"@id":"https:\/\/www.evertop.pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage"},"datePublished":"2020-04-01T08:15:29+00:00","dateModified":"2021-04-30T09:16:05+00:00","breadcrumb":{"@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/www.evertop.pl\/en\/"},{"@type":"ListItem","position":2,"name":"Retrieving Data From The Database"}]},{"@type":"Article","@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#article","isPartOf":{"@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage"},"author":{"@id":"https:\/\/www.evertop.pl\/#\/schema\/person\/67da6133f965ef4876b54ed5cd0509ed"},"headline":"Retrieving Data From The Database","datePublished":"2020-04-01T08:15:29+00:00","dateModified":"2021-04-30T09:16:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#webpage"},"wordCount":602,"publisher":{"@id":"https:\/\/www.evertop.pl\/#organization"},"image":{"@id":"https:\/\/www.evertop.pl\/en\/retrieving-data-from-the-database\/#primaryimage"},"thumbnailUrl":"https:\/\/www.evertop.pl\/wp-content\/uploads\/2020\/04\/coding-man-scaled.jpg","keywords":["entity framework","programming tips"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.evertop.pl\/#\/schema\/person\/67da6133f965ef4876b54ed5cd0509ed","name":"Pawe\u0142 Szymura","image":{"@type":"ImageObject","@id":"https:\/\/www.evertop.pl\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/3c1282144fed3331a59535f2439a6db1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3c1282144fed3331a59535f2439a6db1?s=96&d=mm&r=g","caption":"Pawe\u0142 Szymura"},"url":"https:\/\/www.evertop.pl\/en\/author\/pszymura\/"}]}},"_links":{"self":[{"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/posts\/1852"}],"collection":[{"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/comments?post=1852"}],"version-history":[{"count":5,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/posts\/1852\/revisions"}],"predecessor-version":[{"id":4404,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/posts\/1852\/revisions\/4404"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/media\/4403"}],"wp:attachment":[{"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/media?parent=1852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/categories?post=1852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.evertop.pl\/en\/wp-json\/wp\/v2\/tags?post=1852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}