26 March 2018 08:50
Most migrations that you execute when working with Entity Framework Core are likely to be straightforward - resulting in nothing more than an adjustment to the database schema. Sometimes, however, you might also want to include a task that requires longer than the default command timeout value (30 seconds in SQL Server) such as importing a lot of data.
28 October 2016 08:50
Redesigning a framework from the ground up provides an opportunity to implement an improved API. The team working on Entity Framework Core have certainly grabbed that opportunity in respect of the DbContext class, which sees a bunch of new data manipulation methods not available in Entity Framework 6 or earlier.
11 October 2016 21:40
Entity Framework Core is the new lightweight version of Entity Framework designed to work with .NET Core applications. Just like ASP.NET Core, it has been rewritten from the ground up, and includes some new ways of doing things. One of those is the introduction of the TrackGraph method for handling complex data in disconnected scenarios such as MVC or Web API applications.
16 June 2016 07:38
A key reason behind the decision to use an ORM such as Entity Framework for your data access is to reduce or eliminate the need to write SQL as part of the development process. Nevertheless, there are times when you might need to make use of database stored procedures, and Entity Framework 6 Code First provides support for using existing stored procedures as well as generating new ones.
13 May 2016 08:13
The search facility on this site has been rudimentary at best. I have recently upgraded it to take advantage of the Full-Text Search feature in SQL Server. Although it is still a basic implementation, it is a vast improvement on the search system that existed before, which was based on Entity Framework dynamically generating SQL LIKE clauses. This article describes how I got SQL Server Full-Text Search up and running.
18 June 2015 13:56
This article looks at how to configure Entity Framework to manage many to many relationships based on the same table. This scenario arises the same entity is related to itself in a different role. An example is the related product feature you might see in a "People also bought" section of an ecommerce site. Another is the relationship between clients and agencies in the advertising and marketing world. That scenario will form the basis of the illustration below.
23 April 2015 13:19
This post explores the options available to you when your application requirements include managing and storing time using the Entity Framework. Specifically, I am thinking of durations of time, such as the time required to complete some kind of task, not the time part of a date. Relevant examples might include storing the length of a movie, or the preparation time required for a recipe.
18 February 2015 13:16
If you have built sites with the ASP.NET Razor Web Pages framework, you might want to look at migrating them to ASP.NET MVC at some point. This tutorial is the second in a series of three that explores how you do that by taking a step by step approach to migrating the WebMatrix Bakery template site to ASP.NET MVC 5. Along the way, each of the core parts of MVC are discussed by way of an introduction to the framework. The tutorial is divided into three parts. The first part looked at the roles of the View and Controller. This part looks at the M in MVC, the Model. Specifically, it features data access and view models. The final part will cover model binding and form posting. A download (c. 24MB) featuring the completed application is available on GitHub.
12 January 2015 20:38
This is the latest in a series of "EF Recipes" - short articles that show through practical examples how to achieve common tasks with Entity framework and ASP.NET MVC. This particular example looks at grouping data by year and month in MVC 5 with Entity Framework 6. The article is prompted by an email I got from a reader who asked how I generate the "Archives" feature in the right hand panel on each page on this site.
29 October 2014 20:53
This article looks at using the alphabet for paging data in MVC 5 with Entity Framework 6. Where it differs from most existing articles on alphabetical paging is that this article looks at generating paging links from the data instead of the alphabet. It also features a Bootstrap-friendly helper for generating the paging links.
24 October 2014 22:20
This article explores how to use Entity Framework 6 to manage the retrieval and display of hierarchical data such as you might find in a menu system. There are a number of existing items on the Internet that cover the same topic, but most of them seem unnecessarily complex and don't include any information about displaying the data once it has been retrieved.
13 June 2014 13:42
This tutorial is the last in a series of 12 that teach you how to build MVC 5 applications using Entity Framework for data access and Visual Basic. This final tutorial introduces several topics that are useful to be aware of when you go beyond the basics of developing ASP.NET web applications that use Entity Framework Code First. Step-by-step instructions walk you through the code and using Visual Studio Express For Web for the following topics:
13 June 2014 13:42
This tutorial is the eleventh in a series of 12 that teach you how to build MVC 5 applications using Entity Framework for data access and Visual Basic. In the previous tutorial you handled concurrency exceptions. This tutorial will show you how to implement inheritance in the data model.
13 June 2014 13:41
This tutorial is the tenth in a series of 12 that teach you how to build MVC 5 applications using Entity Framework for data access and Visual Basic. In earlier tutorials you learned how to update data. This tutorial shows how to handle conflicts when multiple users update the same entity at the same time. You'll change the web pages that work with the Department entity so that they handle concurrency errors.
13 June 2014 13:40
This tutorial is the ninth in a series of 12 that teach you how to build MVC 5 applications using Entity Framework for data access and Visual Basic. In earlier tutorials you learned how to read and update data using the synchronous programming model. In this tutorial you see how to implement the asynchronous programming model. Asynchronous code can help an application perform better because it makes better use of server resources.