Entity Framework and ordered indexes
In Entity Framework 7, the team has added support for ordered indexes to the fluent API. In this blog post we will look at how to use this feature and what it means for your database.
In Entity Framework 7, the team has added support for ordered indexes to the fluent API. In this blog post we will look at how to use this feature and what it means for your database.
.NET 6 brought us two new datatypes: DateOnly
and TimeOnly
. For those types we don't have any first class support in Entity Framework - until now.
There is a recent change, that hit us with Entity Framework 8 that might ease the situation and brings native support for those types.
The next iteration of Entity Framework, namely Entity Framework 8, will have a new and exciting feature:
Support raw SQL queries without defining an entity type for the result
That means less boilerplate code!
Pagination is the process of dividing a set into discrete pages. In the context of Entity Framework, that means we are only getting a certain amount of entries from the database.
And we will implement a very easy solution to make that happen in 3 steps. The result will look like this:
var pagedList = DbContext.BlogPosts.ToPagedList(page: 1, pageSize: 5);
Sometimes you have an Id
of an object and want to delete the underlying thing from the database. But it doesn't make sense to load the whole object from the database to memory first. So how can we achieve this quickly?