Categories
.NET Programming

.NET Config Transforms and how they are useful

Config Transforms are a nifty method to have your configuration vary, depending on which build configuration you are running or what servers you are publishing to. This gets the most useful when you’re deploying to many kinds of different servers; Development, staging, production, etc.

Categories
Git

How I handle changelogs using Git tags

I decided to write about how I handle production changelogs with Git using tags. After bunch of commits to my dev branch and when everything has been tested thouroughly, I merge it to master branch.

Categories
SQL Server

Reset IDENTITY field in SQL Server with RESEED

I was trying to reset the IDENTITY value of a table. The problem was I had a foreign key constraint so I couldn’t TRUNCATE the table. That would have solved my problem though.

Categories
.NET

How to create and publish a NuGet package

NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers. This post will teach you how to create and publish your own NuGet package.

Categories
.NET Programming

Problem with SimpleMembership and Roles

I had a problem with SimpleMembership, Authorize attributes and roles. When I ran my program, I occasionally got the following error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is […]

Categories
.NET Programming

WebMatrix SimpleMembership upgrade path

Before Microsoft released MVC 4, I created my project with the good old ASP.NET Membership Provider. After release of MVC 4, Microsoft switched to SimpleMembership by WebMatrix. My project was pretty huge, so I searched for an upgrade path to switch without harming the project. I was in no luck finding a method to switch […]

Categories
.NET Programming

How to mock the DataContext (Entity Framework)

Earlier I wrote an article about how to mock the LINQ DataContext. I promised to write an article about how to do the same method with Entity Framework. It’s quite similar, but the only difference is creating an IDbContext interface and using DbSet<T>.

Categories
.NET Programming

How to mock the DataContext (LINQ)

When it comes to mocking the LINQ DataContext, it’s not an easy task to do, because DataContext (base class) doesn’t implement any interface, so you have to create a wrapper around the DataContext. I decided to follow the Unit Of Work pattern and created also a Generic Repository to access the model classes from the […]