Category Archives: Database

Home / Database
35 Posts

I’ve written a number of posts detailing running and working with stored procedures in Entity Framework 6.x. Yesterday, I ran into a weird issue.

More Link

Over the weekend, I needed to be able to execute a stored procedure from EntityFramework that had a table value parameter (TVP) as an input.

I had never worked with TVP’s before. Utilizing them was not obvious to me from either a code-based approach or even directly with T-SQL. Here’s how I accomplished it, though.

More Link

Earlier today, I needed to be able to retrieve progress indicators from a long-running stored procedure. The procedure itself executed many different queries, so the idea of sending messages to the client between those queries seemed like a good place to start.

More Link

Entity Framework has a nice feature that allows for child navigation properties/collections to be automatically loaded. Essentially, this translates into SQL table joins.

I know this is old news, but I wanted to share a brief experience while updating my own base repositories.

More Link

I’ve said it before, and it bears repeating. LINQ is one of those features in .NET that keeps me using it. In-line queries that allow you to expressively search lists, with the declarative query syntax, is very appealing. Sure, under the covers, it’s performing the heavy lifting, iteration, and such, but the SQL-like lambda expressions are incredibly powerful.

However, sometimes we need something even more dynamic.

More Link

Late last week, I ran into an interesting problem. My current web-based project allows users to perform bulk operations on various database records – up to 1000 records at a time. When dealing with a small number of records, performance was adequate. However, when working with 1000 records, performance was completely unacceptable.

More Link

Entity Framework makes it possible to execute scalar-valued functions when querying models. However, it’s not very intuitive to get this working, and it’s not directly possible to map the returned scalar value to an instance of your model. Odd, right?

More Link

Often in dealing with data in a normalized database, aggregate data is stored on within a parent table. This is done to simplify display of data and general querying.

However, it can cause data to become out of sync if the child tables are edited.

More Link

Entity Framework uses the Unit of Work pattern. It’s useful, but it doesn’t quite cover all of the bases.

In using a repository pattern, I rely on EF to simply deal with UOW and have not had occasion to go beyond UOW. However, on a recent project, I found that I needed to manage my own transactions.

More Link