X

.NET

Reading process output

Here is my little example about how to catch run console program and catch the output. I used similar code to read the output of OpenSLL.

Creating DTOs using AutoMapper

There is one small and nice object to object mapper called AutoMapper. I gave it a little try and I found it very useful. Specially if you have web service and you are using DTOs to move data between client and server. Good news is that AutoMapper is able to perform these mappings and you don't have to write more code than couple of lines. Let’s see example.

Authenticating programmatically to Exchange Server 2003 FBA

In one of my projects I had to read data from Exchange Server 2003 programmatically. I had access to Outlook Web Access that used Form Based Authentication (FBA). After some hacking and testing I got authentication part of my utility work. The point was easy - before making WebDAV requests to Exchange Server we need authentication cookies, so there is active session we can use.

Expert .NET 2.0 IL Assembler

If you want to know how .Net Framework works internally then there is very good book by Serge Lidin - Expert .NET 2.0 IL Assembler. Serge Lidin is author of IL Assembler, IL Disassembler. He is also one of those guys who wrote IL Assembler language specification. So I think he knows the topic very well.

Some extension methods for DateTime

During one of my current projects I wrote some useful extension methods for DateTime class. I had to write custom calendar component and therefore I needed manipulate dates a little bit. Here is some extensions I would like to share with you. And, of course, comments and suggestions are welcome as always. (more…)

Anonymous types in C#

One cool feature of C# 3.0 is support of anonymous types. Let's suppose we have to create some data structure and we need this structure in one place in one method. This far we had to create a new private class or structure. With anonymous types we don't have to define new type - we can create it on the run.

var keyword in C#

C# 3.0 introduced us new language feature: type inference using keyword var. Some guys think that var in C# is same thing as var in PHP. That's wrong - var keyword in C# is totally different thing and it doesn't mean that C# has now support for type changing class attributes. Let's prove it.

Pager class

Once I wrote a class to make paging calculations. I had some data bound user controls that had no paging support. So I had to improvise. As it is was pointless to duplicate pager code to every user control where I needed paging I wrote a class to make my life easier.

Getting distinct values from arrays (through .NET Framework history)

Getting distinct values from arrays is not a unique problem. Here will I show some options how to do it. We are will use array of integer in examples here. This blog entry shows you somehow the mighty evolution of .Net Framework.

Unity and singletons

I just putted up Unity behind my test project and had some troubles with singletons. There is some misleading information in documentation you should be aware of.