Mocking HttpContext – Adding Sessions

Summary In one of my previous posts (See: Mocking HttpContext), I created a HttpContext factory and a mocked HttpContext object that can be used to simulate the HttpContext.Current object used by methods under a unit test.  In this post, I’m going to add the Session capabilities to this object so you can unit test your … Read moreMocking HttpContext – Adding Sessions

Creating Your Own Custom Session ID (Part 2)

Summary In my last post, I talked about how to override the id generator of the HttpContext.Current.Session.  In this post I’m going to show how to override the methods that affect the cookie itself. The ISessionIDManager Interface In order to get at the methods required to manipulate the cookie, you’ll need to implement the ISessionIDManager … Read moreCreating Your Own Custom Session ID (Part 2)

Using Assembly in Visual Studio 2013

Summary In this blog post I’m going to demonstrate how to create an assembly language subroutine and call it from a C++ program. Assembly Language It’s been a few years since I’ve created any assembly language.  In fact, the last time I wrote a real assembly language program the tool to use was Borland’s Turbo … Read moreUsing Assembly in Visual Studio 2013

Entity Framework 6.1.3 vs. Linq2SQL vs. NHibernate Smackdown!

Summary I’ve done these ad-hoc ORM performance tests in the past.  In this test I’m going to re-test the latest Entity Framework (version 6.1.3) against the latest Linq-to-SQL version.  I’ll be using EF code-first this time to make sure there isn’t any extra overhead.  I’ll also be using Visual Studio 2013. The Hardware and Software … Read moreEntity Framework 6.1.3 vs. Linq2SQL vs. NHibernate Smackdown!

Data Caching with Redis and C#

Summary Caching is a very large subject and I’m only going to dive into a small concept that uses Redis, an abstract caching class, and a dummy caching class for unit testing and show how to put it all together for a simple but powerful caching system. Caching Basics The type of caching I’m talking … Read moreData Caching with Redis and C#

EF Code-First Stored Procedures With Parameters

Summary In an earlier post I showed how to create a method that can access a stored procedure using Entity Framework Code-First. In this post I’m going to show how to pass parameters and show a few tricks. The Stored Procedure First, you’ll need to create a new stored procedure in your APIUniversity database (see … Read moreEF Code-First Stored Procedures With Parameters