C#

Currently Browsing Category 'C#'

Caching Data Operations Using Delegates

by Captain Database on Sep 19th in C#

Not too long ago, I had a situation where I wanted to enforce a caching policy on an SOA data model. While this is a pretty trivial alteration, it’s one of those situations where the code will only be as easy to maintain as it is generic. Luckily, insane levels of abstraction (among other things) [...]

Dynamic Code Execution Class

by Captain Database on Jan 29th in C#

So there are times when, in applications of a certain complexity, the need arises to run dynamically generated code. Whether its code from an administrator data rule or template code from a sandbox playground, we’ll need to do it from time to time. So I wrote this simple class that explores the beginnings of dynamic [...]

PLINQO

by Captain Database on Jan 7th in C#

So there’s been a lot of heated debate about Object Relational Mapping (ORM) systems lately. This is pretty understandable given the fact that programmers want to focus on developing, not mindlessly hooking up objects to data stores. I was working on a system for this when LINQ to SQL first came out, and I then [...]

ViewState Properties

by Captain Database on Dec 5th in ASP.NET, C#

If you do much control creation in ASP.NET, you’ve surely had more than your fill of defining ViewState-bound properties. Yes, it’s nice that Visual Studio provides you with a pretty nice default handler, but still, it requires a little too much customization per property. This is a simple task, and personally, I don’t want to [...]

Hybrid Clone

by Captain Database on Mar 30th in C#

OK, since this is a pretty hefty bit of code, I’m going to break this up a little bit.  First, let’s talk about the problem that this code solves and some of the code used to support it. When using a Web Reference in your applications, the development environment is good enough to automatically build [...]

Get Escape

by Captain Database on Mar 23rd in C#

Trying to keep up the momentum I started here and continue to post new things I come up with, even if they are small and meaningless. So, I ran into a situation where I wanted to read a string containing escape sequences and process the escape sequences.  To my delight, I couldn’t find a function [...]

Summarize Exception

by Captain Database on Mar 11th in C#

OK, so to continue on my last blog entry about making code names “pretty” names, let’s talk about some automated exception handling.  We all know that exception handling is a pain, but if you want your code to be robust, it has to be done right. Well, let’s see if we can do it right without too much [...]

Code Name to Pretty Name

by Captain Database on Mar 10th in C#

I came up with a pretty cool piece of code.  I’m sure you’ve been in the following situation: you want to display a database field, enumeration value name, or other variable code name to the user, but you don’t want it to look like MyFieldName or My_Field_Name.  Well, this function is the solution to that [...]

Powered By Wordpress Designed By Ridgey