April 2010 - Posts

1
Comments

Using Unity – Part 4 by nmarun

In this part, I’ll be discussing about constructor and property or setter injection. I’ve created a new class – Product3: 1: public class Product3 : IProduct 2: { 3: public string Name { get; set; } 4: [Dependency] 5: public IDistributor Distributor ...
Filed under: , ,
14
Comments

Using Unity – Part 3 by nmarun

The previous blog was about registering and invoking different types dynamically. In this one I’d like to show how Unity manages/disposes the instances – say hello to Lifetime Managers. When a type gets registered, either through the config file or when...
Filed under: , ,
5
Comments

Using Unity – Part 2 by nmarun

In the first part of this series, we created a simple project and learned how to implement IoC pattern using Unity. In this one, I’ll show how you can instantiate other types that implement our IProduct interface. One place where this one would want to...
Filed under: , ,
5
Comments

Using Unity – Part 1 by nmarun

I have been going through implementing some IoC pattern using Unity and so I decided to share my learnings (I know that’s not an English word, but you get the point). Ok, so I have an ASP.net project named ProductWeb and a class library called ProductModel...
Filed under: , ,
7
Comments

ASP.NET Server-side comments by nmarun

I believe a good number of you know about Server-side commenting. This blog is just like a revival to refresh your memories. When you write comments in your .aspx/.ascx files, people usually write them as: 1: <!-- This is a comment. --> To show...
Filed under: ,
0
Comments

LINQ – SequenceEqual() method by nmarun

I have been looking at LINQ extension methods and have blogged about what I learned from them in my blog space . Next in line is the SequenceEqual() method. Here’s the description about this method: “Determines whether two sequences are equal by comparing...
Filed under: ,
0
Comments

LINQ – Skip() and Take() methods by nmarun

I had this issue recently where I have an array of integers and I’m doing some Skip(n) and then a Take(m) on the collection. Here’s an abstraction of the code: 1: int [] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; 2: var taken = numbers.Skip(3).Take(3...
Filed under: ,
6
Comments

LINQ – TakeWhile and SkipWhile methods by nmarun

I happened to read about these methods on Vikram's blog and tried testing it. Somehow when I saw the output, things did not seem to add up right. I’m writing this blog to show the actual workings of these methods. Let’s take the same example as showing...
Filed under: ,
6
Comments

Tuple - .NET 4.0 new feature by nmarun

Something I hit while playing with .net 4.0 – Tuple. MSDN says ‘ Provides static methods for creating tuple objects. ’ and the example below is: 1: var primes = Tuple.Create(2, 3, 5, 7, 11, 13, 17, 19); Honestly, I’m still not sure with what intention...
Filed under:
More Posts