Tag Archives: aspnet

Home / aspnet
63 Posts

In one of my previous posts, I detailed using Table Value parameters. That method works great for my uses. However, I ran into one gotcha worth pointing out.

More Link

One deficiency with Entity Framework is the ability to load data from a stored procedure or a direct query when the column names don’t match your model property names exactly. In one of my previous posts, I detailed how the EF API can be used to retrieve column mappings. These column mappings can be used in conjunction with a SqlDataReader to map a query result, properly, to your EF model.

More Link

In a previous post, I demoed how to use Table Valued Parameters (TVP’s) with EF. This works great, but, if you’ll notice, it only suppports one-column TVP’s with a simple scalar list of values. I expanded this a bit.

More Link

In an application that I’m currently working on, that deals with Sales data, there are instances when I need to apply date comparisons relative to a user’s local time. This is an interesting problem with which to deal.

More Link

Ninject is one of the better dependency injection frameworks, IMHO. However, within the context of .NET Threads and thread pooling, scoping of objects doesn’t work quite as expected.

More Link

For services that I write that repeat a task over a set interval, I generally use a simple repeater loop. For the cases where I needed a bit more granular control of how/when Tasks repeat, I created a simple scheduler with a Fluent API.

More Link

.NET doesn’t have a very good way, that I’m aware of, to limit the number of Tasks/Threads that can be running at a single time. This can create issues where, for example, you are queuing up thousands of jobs that run against a finite set of resources.

More Link

ASP.NET’s built in CSRF (Cross-site request forgery) is pretty straight forward. You add a token to your views via an HTML Helper, and then decorate your controller actions with a specific attribute to validate the token on POST. There are many times, seemingly randomly, where users have invalid tokens on their requests. MVC throws a 500 error with an HttpAntiForgeryException. For legitimate users, this is not an optimal experience.

More Link

With OWIN and .NET 4.6.x, it was pretty straight forward to enable SSL (TLS), and redirect all requests to the HTTPS end-point with Visual Studio’s tooling (IIS Express). It’s not quite as straight forward to accomplish this in .NET Core.

More Link