Linq To SQL in a N-Tier Application

17. December 2009

When doing Domain Driven Development (DDD) people have tried to make Linq To SQL work as the Data Layer. I have seen a few implementations of this that were not very clean and made more work for the developer. A common solution I’ve seen has been to use the LINQ generated Entities from the dbml file and “convert” them into the corresponding Domain Entity. In this post I will show you how to manually write your Linq to SQL classes to work with your existing Domain Model to avoid such conversions.

More...

LINQ, SQL Server, .NET 4.0 , , , ,

ASP.NET Uploading and Resizing Images

11. October 2009

When working on the web whether it be a full blown CMS or a small product cart. The issue of how to upload images, and especially resize them to fit your site comes up quite a bit. C# has a useful image library that you can use to resize your images to fit your needs. This post will show you how to upload the file, manipulate it, and then save it so that it can be used where you need it.

More...

ASP.NET, SQL Server, General, LINQ , , ,

Generate a Custom Password using SQLMembership Provider

26. August 2009

We use SQLMembership provider a lot; however, we always add custom logic and extended fields in the database for the user (relating the login in the membership provider to our tables). Recently we had a request that the client wanted to "reset" their user's passwords and give be able to tell them their new password verbally.

More...

LINQ, ASP.NET , ,

TripleDES Encrypt/Decrypt Extension Methods

12. August 2009

Every developer has reusable utilities that they have created and perfected during their time in development. One of the most favorite ones in my arsenal is a utility to encrypt and decrypt strings using TripleDES encryption.

More...

General ,

I love the Coalesce operator in C#

11. August 2009

Recently I was given a requirement where clients can enter alternate text for particular content and even alternate text to the alternate text. They wanted it so that the default text would only show if the first and second alternate text was null.

More...

.NET 3.5, LINQ, General , ,