{"id":91746,"date":"2023-07-13T12:30:30","date_gmt":"2023-07-13T10:30:30","guid":{"rendered":"https:\/\/code-maze.com\/?p=91746"},"modified":"2023-12-18T09:42:48","modified_gmt":"2023-12-18T08:42:48","slug":"entityframeworkcore-vs-dapper","status":"publish","type":"post","link":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/","title":{"rendered":"EntityFramework Core vs Dapper"},"content":{"rendered":"<p>In this article, we will discuss the differences between <strong>EntityFramework Core<\/strong> and <strong>Dapper<\/strong>.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/dotnet-efcore\/EntityFrameworkCoreVsDapper\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>EntityFramework Core and Dapper are .NET libraries widely used for<strong> data access and management<\/strong>. Both are Object-Relational-Mappers (ORMs), so to gain a better understanding, let&#8217;s first dive into the concept of Object-Relational-Mapping.<\/p>\n<h2><a id=\"UnderstandingObject-Relational-Mapping\"><\/a>Understanding Object-Relational-Mapping<\/h2>\n<p>Object-Relational Mapping is a technique we apply to facilitate the <strong>interaction between a database and an application<\/strong>. It achieves this by leveraging the object-oriented paradigm and providing an abstraction layer that translates our code into SQL. In simple terms, it allows us to work with databases using programming languages we are familiar with.<\/p>\n<p>Object-Relational-Mappers are libraries specifically designed for this purpose.<\/p>\n<h2><a id=\"EntityFrameworkCore\"><\/a>EntityFramework Core<\/h2>\n<p>EF Core is a<strong> full-fledged ORM<\/strong> that provides a high-level abstraction over the database. It offers an extensive selection of APIs, which facilitate seamless data access and manipulation.<\/p>\n<p>Let&#8217;s give an example of how EntityFramework Core works by retrieving a list of 1000 persons:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public List&lt;Person&gt; GetXPersonsEFCore(int personsNumber)\r\n{\r\n    return _context.Persons.Take(personsNumber).ToList();  \r\n}\r\n\r\nvar personsRepository = new PersonsRepository();\u00a0\r\npersonsRepository.GetXPersonsEFCore(1000);<\/pre>\n<p>Of course, this is just a simple example, and we are not going to dive deep into EF Core as that&#8217;s not the topic here. But, for a deep dive, you can check our <a href=\"https:\/\/code-maze.com\/entity-framework-core-series\/\" target=\"_blank\" rel=\"noopener\">series on EF Core<\/a>.<\/p>\n<h2><a id=\"Dapper\"><\/a>Dapper<\/h2>\n<p>Dapper is a<strong> simple micro-ORM<\/strong> that provides fast and efficient data access as it executes raw SQL queries.<\/p>\n<p>This time, we will execute the same query using Dapper:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public List&lt;Person&gt; GetXPersonsDapper(int personsNumber)\r\n{\r\n    _dbConnection.Open();\r\n\r\n    return _dbConnection.Query&lt;Person&gt;($\"SELECT TOP({personsNumber}) * FROM Persons\").ToList();\r\n}\r\n\r\nvar personsRepository = new PersonsRepository();\r\npersonsRepository.GetXPersonsDapper(1000);\r\n<\/pre>\n<p>Again, we are not going to deep dive into Dapper here, but feel free to check our <a href=\"https:\/\/code-maze.com\/using-dapper-with-asp-net-core-web-api\/\" target=\"_blank\" rel=\"noopener\">article on Dapper<\/a> to get deeper into this topic.<\/p>\n<h2><a id=\"Differences\"><\/a>Dapper and Entity Framework Core Differences<\/h2>\n<p>Now that we have a general view of EF Core&#8217;s and Dapper&#8217;s basic mechanics let&#8217;s continue with their differences.<\/p>\n<h3><a id=\"FlexibilityAndFeatures\"><\/a>Flexibility and Features<\/h3>\n<p>Dapper empowers us to have <strong>fine-grained control over the SQL statements<\/strong>, by allowing us to write SQL statements ourselves. As a result, it enables optimization tailored to our specific needs. However, it is important to note that such a level of control <strong>requires us to ensure the security and correctness<\/strong> of the SQL statements we construct. We need to take precautions to ensure that we properly format our queries and optimize them for efficient database operations.<\/p>\n<p>On the other hand, EF Core provides a <strong>higher-level, object-oriented approach to database operations<\/strong>. It allows us to focus on our application logic while minimizing the need for boilerplate code. Additionally, it offers a <strong>comprehensive range of features<\/strong> for efficient database schema management.<\/p>\n<p>For example, EF Core supports <a href=\"https:\/\/code-maze.com\/migrations-and-seed-data-efcore\/\" target=\"_blank\" rel=\"noopener\">migrations<\/a> &#8211; a mechanism facilitating easy and seamless updates to the database structure. Furthermore, it provides support for both <a href=\"https:\/\/code-maze.com\/net-core-web-api-ef-core-code-first\/\" target=\"_blank\" rel=\"noopener\">code-first<\/a> and <a href=\"https:\/\/code-maze.com\/asp-net-core-web-api-with-ef-core-db-first-approach\/\" target=\"_blank\" rel=\"noopener\">database-first<\/a> approaches. This enables us to select the approach that best suits our specific requirements.<\/p>\n<h3><a id=\"LearningCurve\"><\/a>Learning Curve<\/h3>\n<p>Dapper offers a relatively <strong>low learning curve <\/strong>due to its reliance on raw SQL queries and simplicity. As a result, if we are familiar with SQL we can quickly grasp Dapper&#8217;s <strong>straightforward syntax<\/strong> and seamlessly integrate this ORM into our code.<\/p>\n<p>Conversely, EF Core serves as a comprehensive ORM, demanding a<strong> steeper learning curve<\/strong>. Particularly for some of us who are new to developing, to comprehend the entire framework and its extensive functionalities might be difficult. However, <strong>in the long run, we can enhance our productivity<\/strong> with Entity Framework Core, benefiting from its diverse range of features.<\/p>\n<p>Lastly, it is important to note that despite using EF Core, we should still possess SQL knowledge to ensure accurate and efficient implementations.\u00a0<\/p>\n<h3><a id=\"StrongTyping\"><\/a>Strong Typing<\/h3>\n<p>Dapper <strong>doesn&#8217;t provide strong typing as it uses object mapping to populate data into plain CLR objects<\/strong> (<a href=\"https:\/\/code-maze.com\/difference-dto-poco\/\" target=\"_blank\" rel=\"noopener\">POCOs<\/a>). We usually do the mapping through reflection or by specifying the mappings manually. While we can manually map query results to strongly typed objects, Dapper does not enforce or provide automatic strong typing.<\/p>\n<p>EF Core generates <strong>strongly typed entity classes based on the database schema<\/strong>. These classes have properties with types that correspond to the underlying database columns. This provides strong typing when working with entities, helping to catch type-related errors at compile time.<\/p>\n<h3><a id=\"CompileTimeChecking\"><\/a>Compile-Time Checking<\/h3>\n<p>Dapper relies on SQL queries, which we provide as plain strings. As a result, we <strong>discover any issues or errors in queries and mappings during runtime<\/strong>.<\/p>\n<p>By comparison, EF Core provides a significant level of <strong>compile-time validation of query syntax and property mapping<\/strong>. This ensures the <a href=\"https:\/\/code-maze.com\/linq-csharp-basic-concepts\/\" target=\"_blank\" rel=\"noopener\">LINQ<\/a> queries are syntactically correct and aligned with the entities schema. It&#8217;s important to note that dynamic query validation occurs during the evaluation and compilation of expression trees and anonymous methods in EntityFramework Core. As a result, runtime type<strong> mismatches, validation issues, and other types of exceptions can still occur in EF<\/strong>.<\/p>\n<h3><a id=\"Performance\"><\/a>Performance<\/h3>\n<p>Dapper has gained widespread recognition for its <strong>good performance<\/strong>. It boasts <strong>lower memory usage and shorter execution times<\/strong> because it relies on raw SQL queries. Queries that we have already optimized.<\/p>\n<p>In contrast, EF Core <strong>introduces a significant overhead<\/strong> due to its abstraction layer, as it automatically generates SQL statements, which may not always result in the most optimal approach. However, it <strong>offers several performance optimization techniques<\/strong>, including caching and change tracking, which can enhance overall performance.<\/p>\n<p><span style=\"font-weight: 400;\">With that said, let\u2019s see<\/span> and compare the execution times of these two ORMs for the retrieval of 10,000, 100,000, and 1,000,000 persons:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">|            Method | personsNumber |       Mean |     Error |    StdDev |     Median |\r\n|------------------ |-------------- |-----------:|----------:|----------:|-----------:|\r\n| GetXPersonsDapper |         10000 |   9.456 ms | 0.6449 ms |  1.891 ms |   8.582 ms |\r\n| GetXPersonsEFCore |         10000 |  33.976 ms | 1.0980 ms |  2.987 ms |  32.948 ms |\r\n|                   |               |            |           |           |            |\r\n| GetXPersonsDapper |        100000 | 108.760 ms | 2.1549 ms |  4.908 ms | 107.011 ms |\r\n| GetXPersonsEFCore |        100000 | 439.645 ms | 8.7468 ms | 10.742 ms | 437.660 ms |\r\n|                   |               |            |           |           |            |\r\n| GetXPersonsDapper |       1000000 | 109.266 ms | 2.0619 ms |  3.330 ms | 103.615 ms |\r\n| GetXPersonsEFCore |       1000000 | 440.308 ms | 7.8482 ms |  9.925 ms | 441.423 ms |<\/pre>\n<p>In these tests, dapper exhibits a noticeably higher performance than EF Core. That said, <strong>this is a simple example as there are many variables that can affect EF Core queries (as we already mentioned) and those results can be much faster<\/strong>.<\/p>\n<p>So, let&#8217;s just see how using the <code>AsNoTracking()<\/code> method with EF Core query can change the results:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\">|            Method | personsNumber |       Mean |     Error |    StdDev |     Median |\r\n|------------------ |-------------- |-----------:|----------:|----------:|-----------:|\r\n| GetXPersonsDapper |         10000 |   9.456 ms | 0.6449 ms |\u00a0 1.891 ms |   8.582 ms |\r\n| GetXPersonsEFCore |         10000 |  12.762 ms | 1.1027 ms |  3.234 ms |  11.057 ms |\r\n|                   |               |            |           |           |            |\r\n| GetXPersonsDapper |        100000 | 108.760 ms | 2.1549 ms |  4.908 ms | 107.011 ms |\r\n| GetXPersonsEFCore |        100000 | 130.625 ms | 2.5758 ms |  5.866 ms | 130.205 ms |\r\n|                   |               |            |           |           |            |\r\n| GetXPersonsDapper |       1000000 | 109.266 ms | 2.0619 ms |  3.330 ms | 103.615 ms |\r\n| GetXPersonsEFCore |       1000000 | 134.120 ms | 3.0254 ms |  8.873 ms | 133.119 ms |<\/pre>\n<p>We can clearly see that by properly tracking (or in this case not tracking) changes can seriously affect the EF Core results. Even though Dapper still performs faster, now the results are much closer.\u00a0<\/p>\n<h2><a id=\"WhatToChoose\"><\/a>What to Choose?<\/h2>\n<p>Now that we have gained a general understanding of the differences between <strong>EntityFramework Core<\/strong> and <strong>Dapper<\/strong>, let&#8217;s explore the <strong>scenarios in which each one excels<\/strong>.<\/p>\n<h3><a id=\"WhenToUseDapper\"><\/a>When to Use Dapper<\/h3>\n<p>In scenarios where <strong>performance and resource management<\/strong> take precedence, we lean toward utilizing Dapper. This preference is especially evident when we possess advanced SQL knowledge and seek to <strong>optimize our queries<\/strong> accordingly. Moreover, Dapper finds an application in <strong>large databases<\/strong> where query execution time incurs significant costs.<\/p>\n<p>Dapper&#8217;s lightweight design makes it a compelling option for applications that prioritize high-performance data retrieval. Moreover by bypassing the overhead of full-fledged ORMs, Dapper enables <strong>efficient and fast data mapping<\/strong>, resulting in improved application performance.<\/p>\n<h3><a id=\"WhenToUseEFCore\"><\/a>When to Use EF Core<\/h3>\n<p>In contrast, EF Core excels in scenarios where we focus on <strong>productivity, abstraction, and convenience<\/strong>. Swift application development and instances where we prioritize working with object-oriented paradigms find it to be a perfect fit. With its automated query generation, change tracking, and migration features, EF Core <b>simplifies database interaction and schema updates<\/b>.<\/p>\n<p>Furthermore, EF Core&#8217;s proficiency in <strong>managing intricate relationships,<\/strong> and its compatibility across multiple database providers make it the ideal choice for applications with <strong>complex data modeling needs<\/strong>. Its comprehensive management capabilities ensure smooth operations and efficient handling of data, empowering developers to build robust and scalable applications.<\/p>\n<h2><a id=\"Conclusion\"><\/a>Conclusion<\/h2>\n<p>In summary, in this article, we examined <strong>EntityFramework Core<\/strong> and <strong>Dapper<\/strong> and their <strong>basic mechanics,<\/strong> as well as provided a comprehensive understanding of these two popular .NET libraries. We also analyzed the two ORMs&#8217; <strong>differences<\/strong> in their flexibility and features, learning curve, strong typing support, compile-time checking, and performance characteristics. Last but not least, we analyzed the <strong>circumstances in which we should use each library<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will discuss the differences between EntityFramework Core and Dapper. EntityFramework Core and Dapper are .NET libraries widely used for data access and management. Both are Object-Relational-Mappers (ORMs), so to gain a better understanding, let&#8217;s first dive into the concept of Object-Relational-Mapping. Understanding Object-Relational-Mapping Object-Relational Mapping is a technique we apply to [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62194,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1647,1208],"tags":[22,1811,889,343],"class_list":["post-91746","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dapper","category-entityframeworkcore","tag-net-core","tag-c","tag-dapper","tag-ef-core","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>EntityFramework Core vs Dapper<\/title>\n<meta name=\"description\" content=\"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"EntityFramework Core vs Dapper\" \/>\n<meta property=\"og:description\" content=\"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-13T10:30:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-18T08:42:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"EntityFramework Core vs Dapper\",\"datePublished\":\"2023-07-13T10:30:30+00:00\",\"dateModified\":\"2023-12-18T08:42:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\"},\"wordCount\":1255,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png\",\"keywords\":[\".NET CORE\",\"C#\",\"Dapper\",\"EF Core\"],\"articleSection\":[\"Dapper\",\"EntityFrameworkCore\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\",\"url\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\",\"name\":\"EntityFramework Core vs Dapper\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png\",\"datePublished\":\"2023-07-13T10:30:30+00:00\",\"dateModified\":\"2023-12-18T08:42:48+00:00\",\"description\":\"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png\",\"width\":1100,\"height\":620,\"caption\":\"Entity Framework\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"EntityFramework Core vs Dapper\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"EntityFramework Core vs Dapper","description":"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.","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:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/","og_locale":"en_US","og_type":"article","og_title":"EntityFramework Core vs Dapper","og_description":"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.","og_url":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/","og_site_name":"Code Maze","article_published_time":"2023-07-13T10:30:30+00:00","article_modified_time":"2023-12-18T08:42:48+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"EntityFramework Core vs Dapper","datePublished":"2023-07-13T10:30:30+00:00","dateModified":"2023-12-18T08:42:48+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/"},"wordCount":1255,"commentCount":4,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png","keywords":[".NET CORE","C#","Dapper","EF Core"],"articleSection":["Dapper","EntityFrameworkCore"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/","url":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/","name":"EntityFramework Core vs Dapper","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png","datePublished":"2023-07-13T10:30:30+00:00","dateModified":"2023-12-18T08:42:48+00:00","description":"Discover the differences between EntityFramework Core and Dapper, and the use cases to choose the right tool for our data access needs.","breadcrumb":{"@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-entity-framewrok.png","width":1100,"height":620,"caption":"Entity Framework"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/entityframeworkcore-vs-dapper\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"EntityFramework Core vs Dapper"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/91746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=91746"}],"version-history":[{"count":9,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/91746\/revisions"}],"predecessor-version":[{"id":92232,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/91746\/revisions\/92232"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62194"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=91746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=91746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=91746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}