
{"id":16,"date":"2023-05-04T07:08:10","date_gmt":"2023-05-04T06:08:10","guid":{"rendered":"https:\/\/ishooscode.com\/?p=16"},"modified":"2023-06-01T09:12:42","modified_gmt":"2023-06-01T08:12:42","slug":"implementing-repository-with-aspnetcore-mvc","status":"publish","type":"post","link":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/","title":{"rendered":"Implementing Repository with AspNetCore MVC"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Icon.png\" alt=\"\" class=\"wp-image-17\" width=\"839\" height=\"470\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.<br>I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Prerequisite<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Prior knowledge of MVC and Entity framework<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s begin<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Project Creation<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am using visual studio 2019 community edition.<br>Open your IDE and create .net core MVC project<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"93\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/CreateNew.png\" alt=\"\" class=\"wp-image-19\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/CreateNew.png 360w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/CreateNew-300x78.png 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Select Asp.Net Core Web Application and press next<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"511\" height=\"117\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/NewCorProject.png\" alt=\"\" class=\"wp-image-20\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/NewCorProject.png 511w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/NewCorProject-300x69.png 300w\" sizes=\"auto, (max-width: 511px) 100vw, 511px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Name your solution and create<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"610\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Create.png\" alt=\"\" class=\"wp-image-21\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Create.png 944w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Create-300x194.png 300w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Create-768x496.png 768w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Create-850x549.png 850w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Project is created<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution will have Controller, Model, View folder and one new wwwroot folder and few more files named appsetting.json, Startup.cs, Program.cs<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s understand what these files are?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Appsetting.json file is your web.config file<br>Program.cs file is same as in your console application and is called once for the entire application life cycle<br>Startup.cs is used for configuring your .net core application<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let us create a small module of adding product in Ecommerce website<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Model<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First create a Product model in, for that we will create a new .net core class library project in same solution<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>namespace ECommerce.Entity\n{\n&nbsp;&nbsp;&nbsp; &#91;Table(\"Product\")]\n&nbsp;&nbsp;&nbsp; public class Product\n&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Key]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string ProductId { get; set;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;MaxLength(50)]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string ProductName { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;MaxLength(300)]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string ProductDescription { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;DisplayName(\"Category\")]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string CategoryId { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double QuantityPerUnit { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double UnitPrice { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double MSRP { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double AvailableSize { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string AvailableColor { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double Discount { get; set; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double UnitWeight { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;Required]\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double UnitsInStock { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double UnitsOnOrder { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double ProductAvailability { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string Picture { get; set; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public string Note { get; set; }\n&nbsp;&nbsp;&nbsp; }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This model will be used to save data and bind view and controller.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Entity framework core Context<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next step is to create Entity framework core context. For that we create a new .net core class library project and install a nugget package in it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"74\" src=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/EntityframeworkCore.png\" alt=\"\" class=\"wp-image-22\" srcset=\"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/EntityframeworkCore.png 655w, https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/EntityframeworkCore-300x34.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Create a ECommerceContext class<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class ECommerceContext : DbContext\n&nbsp;&nbsp;&nbsp; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ECommerceContext(DbContextOptions&lt;ECommerceContext&gt; options) : base(options)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public DbSet&lt;Product&gt; Products { get; set; }\n&nbsp;&nbsp;&nbsp; }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Repository<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let\u2019s create a new .net core class library project named Ecommerce.IRepositories<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And create an interface in the project. This project will only contain Interfaces<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface IProductRepository\n{\n&nbsp;&nbsp;&nbsp; IList&lt;Product&gt; GetProducts();\n&nbsp;&nbsp;&nbsp; Product GetProduct(string productId);\n&nbsp;&nbsp;&nbsp; void Add(Product product);\n&nbsp;&nbsp;&nbsp; Product Update(Product product);\n&nbsp;&nbsp;&nbsp; void Delete(Product product);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Interfaces plays key roles in making application loosely coupled and more injectable more<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To implement this interface we\u2019ll create another .net core class library project for repository<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Name Ecommerce.Repositories and create a class<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class ProductRepository : IProductRepository\n{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private readonly ECommerceContext productContext;\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ProductRepository(ECommerceContext context)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext = context;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void Add(Product product)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; product.ProductId = Guid.NewGuid().ToString();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext.Add(product);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext.SaveChanges();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void Delete(Product product)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext.Products.Remove(product);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext.SaveChanges();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public IList&lt;Product&gt; GetProducts()\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return productContext.Products.ToList();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Product GetProduct(string productId)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return productContext.Products.FirstOrDefault(x=&gt; x.ProductId == productId);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Product Update(Product productChanges)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var product = productContext.Products.Attach(productChanges);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; product.State = Microsoft.EntityFrameworkCore.EntityState.Modified;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productContext.SaveChanges();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return productChanges;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp; }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we have created our context, our model and our repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Application<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s time to create controller named ProductController.cs and inject all the dependency in it. To inject the dependencies we need to configure startup.cs file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add following code in ConfigureService method<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services.AddScoped&lt;IProductRepository, ProductRepository&gt;();\nservices.AddDbContextPool&lt;ECommerceContext&gt;(x =&gt; x.UseSqlServer(ConnectionString, b =&gt; b.MigrationsAssembly(\"ECommerce\")));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">controller will look like below code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>IProductRepository productRepo = null;\n\npublic ProductController(IProductRepository prodRepo)\n{\n    productRepo = prodRepo;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see we are using parameterized constructor of controller to inject the dependency.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">.net core there is a build in support for dependency injection<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services.AddScoped&lt;IProductRepository, ProductRepository&gt;();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Above line is used to inject any dependency in controller<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below method is used to save Product detail in database<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public ActionResult SaveProduct(Product product)\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int res = 3;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ModelState.IsValid)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (string.IsNullOrEmpty(product.ProductId))\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; productRepo.Add(product);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; product = productRepo.Update(product);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; res = 1;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return View(\"Create\");\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">View to controller binding is same as it was in MVC application and I understand you guys are better at that so not going through with it<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Notes<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you look at the Repository class, I have injected context class in its constructor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Summary<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is how you create a .net core MVC application with Repository and dependency injection which is loosely coupled and easily configurable<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am open to all kind of discussion. Feel free to comment and suggest anything<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more details please <a href=\"https:\/\/www.c-sharpcorner.com\/members\/ishoo-agarwal\" target=\"_blank\" rel=\"noopener\" title=\"visit \">visit <\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other. Prerequisite Prior knowledge of MVC and Entity framework Let\u2019s begin Project [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"wpai_generated_summary":"","wpai_tts_display_audio":true,"footnotes":""},"categories":[23,22],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-aspdotnet","category-c-sharp"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other. Prerequisite Prior knowledge of MVC and Entity framework Let\u2019s begin Project Explore the step-by-step guide to implementing a repository pattern with ASP.NET Core MVC. Learn how to create a flexible and scalable data access layer using repository design principles. Discover the benefits of decoupling data persistence logic from your application, improving testability and maintainability. Gain practical insights and best practices for leveraging the repository pattern in your ASP.NET Core projects. Join IshoosCode as we empower you to build robust and efficient web applications with a solid repository architecture.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"ishooagarwal@gmail.com\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ishoo&#039;s Code -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How can we implement repository pattern in MVC with .net core\" \/>\n\t\t<meta property=\"og:description\" content=\"Repository pattern is very famous design pattern in modern coding and is easy to implement in any code. It allows dependency injection and can be clubbed with other patterns easily like unit of work.Repository pattern allow us to perform database operation in more streamlined approach. We do not have to create concrete instance of class which helps us in increasing testability of code as well.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-05-04T06:08:10+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-06-01T08:12:42+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How can we implement repository pattern in MVC with .net core\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Repository pattern is very famous design pattern in modern coding and is easy to implement in any code. It allows dependency injection and can be clubbed with other patterns easily like unit of work.Repository pattern allow us to perform database operation in more streamlined approach. We do not have to create concrete instance of class which helps us in increasing testability of code as well.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#blogposting\",\"name\":\"Implementing Repository with AspNetCore MVC - Dot Net Core\",\"headline\":\"Implementing Repository with AspNetCore MVC\",\"author\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/Icon.png\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#articleImage\",\"width\":300,\"height\":168,\"caption\":\"Dependency Injection in ASP.Net classes for TDD\"},\"datePublished\":\"2023-05-04T07:08:10+01:00\",\"dateModified\":\"2023-06-01T09:12:42+01:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#webpage\"},\"articleSection\":\"Asp.net, C#\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ishooscode.com\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"name\":\"C#\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"position\":2,\"name\":\"C#\",\"item\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#listItem\",\"name\":\"Implementing Repository with AspNetCore MVC\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#listItem\",\"position\":3,\"name\":\"Implementing Repository with AspNetCore MVC\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/category\\\/c-sharp\\\/#listItem\",\"name\":\"C#\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\",\"name\":\"ishooagarwal@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"ishooagarwal@gmail.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/\",\"name\":\"ishooagarwal@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"ishooagarwal@gmail.com\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#webpage\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/\",\"name\":\"Implementing Repository with AspNetCore MVC - Dot Net Core\",\"description\":\"In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other. Prerequisite Prior knowledge of MVC and Entity framework Let\\u2019s begin Project Explore the step-by-step guide to implementing a repository pattern with ASP.NET Core MVC. Learn how to create a flexible and scalable data access layer using repository design principles. Discover the benefits of decoupling data persistence logic from your application, improving testability and maintainability. Gain practical insights and best practices for leveraging the repository pattern in your ASP.NET Core projects. Join IshoosCode as we empower you to build robust and efficient web applications with a solid repository architecture.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/2023\\\/05\\\/04\\\/implementing-repository-with-aspnetcore-mvc\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/index.php\\\/author\\\/ishooagarwalgmail-com\\\/#author\"},\"datePublished\":\"2023-05-04T07:08:10+01:00\",\"dateModified\":\"2023-06-01T09:12:42+01:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#website\",\"url\":\"https:\\\/\\\/ishooscode.com\\\/\",\"name\":\"ishooscode.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/ishooscode.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Implementing Repository with AspNetCore MVC - Dot Net Core","description":"In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other. Prerequisite Prior knowledge of MVC and Entity framework Let\u2019s begin Project Explore the step-by-step guide to implementing a repository pattern with ASP.NET Core MVC. Learn how to create a flexible and scalable data access layer using repository design principles. Discover the benefits of decoupling data persistence logic from your application, improving testability and maintainability. Gain practical insights and best practices for leveraging the repository pattern in your ASP.NET Core projects. Join IshoosCode as we empower you to build robust and efficient web applications with a solid repository architecture.","canonical_url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#blogposting","name":"Implementing Repository with AspNetCore MVC - Dot Net Core","headline":"Implementing Repository with AspNetCore MVC","author":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"publisher":{"@id":"https:\/\/ishooscode.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/ishooscode.com\/wp-content\/uploads\/2023\/05\/Icon.png","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#articleImage","width":300,"height":168,"caption":"Dependency Injection in ASP.Net classes for TDD"},"datePublished":"2023-05-04T07:08:10+01:00","dateModified":"2023-06-01T09:12:42+01:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#webpage"},"isPartOf":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#webpage"},"articleSection":"Asp.net, C#"},{"@type":"BreadcrumbList","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/#listItem","position":1,"name":"Home","item":"https:\/\/ishooscode.com\/","nextItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","name":"C#"}},{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","position":2,"name":"C#","item":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/","nextItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#listItem","name":"Implementing Repository with AspNetCore MVC"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#listItem","position":3,"name":"Implementing Repository with AspNetCore MVC","previousItem":{"@type":"ListItem","@id":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/#listItem","name":"C#"}}]},{"@type":"Person","@id":"https:\/\/ishooscode.com\/#person","name":"ishooagarwal@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g","width":96,"height":96,"caption":"ishooagarwal@gmail.com"}},{"@type":"Person","@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author","url":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/","name":"ishooagarwal@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0ea4396d285fbb3d9c79bf9c2073c85d136b778750ab18d6edb4f53eb3ee18a9?s=96&d=mm&r=g","width":96,"height":96,"caption":"ishooagarwal@gmail.com"}},{"@type":"WebPage","@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#webpage","url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/","name":"Implementing Repository with AspNetCore MVC - Dot Net Core","description":"In this blog I will create an application using .net Core MVC and Entity framework core implementing Repository pattern and Dependency Injection.I will make the application loosely coupled as much as possible. Data access layer and UI will be completely independent of each other. Prerequisite Prior knowledge of MVC and Entity framework Let\u2019s begin Project Explore the step-by-step guide to implementing a repository pattern with ASP.NET Core MVC. Learn how to create a flexible and scalable data access layer using repository design principles. Discover the benefits of decoupling data persistence logic from your application, improving testability and maintainability. Gain practical insights and best practices for leveraging the repository pattern in your ASP.NET Core projects. Join IshoosCode as we empower you to build robust and efficient web applications with a solid repository architecture.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/ishooscode.com\/#website"},"breadcrumb":{"@id":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/#breadcrumblist"},"author":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"creator":{"@id":"https:\/\/ishooscode.com\/index.php\/author\/ishooagarwalgmail-com\/#author"},"datePublished":"2023-05-04T07:08:10+01:00","dateModified":"2023-06-01T09:12:42+01:00"},{"@type":"WebSite","@id":"https:\/\/ishooscode.com\/#website","url":"https:\/\/ishooscode.com\/","name":"ishooscode.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/ishooscode.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Ishoo's Code -","og:type":"article","og:title":"How can we implement repository pattern in MVC with .net core","og:description":"Repository pattern is very famous design pattern in modern coding and is easy to implement in any code. It allows dependency injection and can be clubbed with other patterns easily like unit of work.Repository pattern allow us to perform database operation in more streamlined approach. We do not have to create concrete instance of class which helps us in increasing testability of code as well.","og:url":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/","article:published_time":"2023-05-04T06:08:10+00:00","article:modified_time":"2023-06-01T08:12:42+00:00","twitter:card":"summary_large_image","twitter:title":"How can we implement repository pattern in MVC with .net core","twitter:description":"Repository pattern is very famous design pattern in modern coding and is easy to implement in any code. It allows dependency injection and can be clubbed with other patterns easily like unit of work.Repository pattern allow us to perform database operation in more streamlined approach. We do not have to create concrete instance of class which helps us in increasing testability of code as well."},"aioseo_meta_data":{"post_id":"16","title":"#post_title #separator_sa Dot Net Core","description":"#post_excerpt Explore the step-by-step guide to implementing a repository pattern with ASP.NET Core MVC. Learn how to create a flexible and scalable data access layer using repository design principles. Discover the benefits of decoupling data persistence logic from your application, improving testability and maintainability. Gain practical insights and best practices for leveraging the repository pattern in your ASP.NET Core projects. Join IshoosCode as we empower you to build robust and efficient web applications with a solid repository architecture.","keywords":[],"keyphrases":{"focus":{"keyphrase":"Repository pattern in MVC","score":44,"analysis":{"keyphraseInTitle":{"score":3,"maxScore":9,"error":1},"keyphraseInDescription":{"score":3,"maxScore":9,"error":1},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":4},"keyphraseInURL":{"score":1,"maxScore":5,"error":1},"keyphraseInIntroduction":{"score":3,"maxScore":9,"error":1},"keyphraseInSubHeadings":[],"keyphraseInImageAlt":{"score":3,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":"How can we implement repository pattern in MVC with .net core","og_description":"Repository pattern is very famous design pattern in modern coding and is easy to implement in any code. It allows dependency injection and can be clubbed with other patterns easily like unit of work.Repository pattern allow us to perform database operation in more streamlined approach. We do not have to create concrete instance of class which helps us in increasing testability of code as well.","og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2023-05-04 05:48:57","updated":"2026-11-03 09:42:08","focus_keyword":"Repository pattern in MVC","additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/ishooscode.com\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/\" title=\"C#\">C#<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tImplementing Repository with AspNetCore MVC\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/ishooscode.com\/"},{"label":"C#","link":"https:\/\/ishooscode.com\/index.php\/category\/c-sharp\/"},{"label":"Implementing Repository with AspNetCore MVC","link":"https:\/\/ishooscode.com\/index.php\/2023\/05\/04\/implementing-repository-with-aspnetcore-mvc\/"}],"_links":{"self":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":8,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":60,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/posts\/16\/revisions\/60"}],"wp:attachment":[{"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ishooscode.com\/index.php\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}