Category Archives: C# 5

Async programming and scalability with C# 5

What is Scalability? Scalability is the ability of a system to expand to meet your business needs. You scale a system by adding extra hardware or by upgrading the existing hardware without changing much of the application. In the context … Continue reading

Posted in .NET, .NET 4.5, C# 5 | Leave a comment

Closures in c#

As a c# developers we write a lot of lambda expressions. And with lambda expressions we can access variables outside the expression block. For Example: class Program { static Func<int,int> Add; static void Main(string[] args) { int x = 5; … Continue reading

Posted in .NET, .NET 4.5, C# 5 | Tagged | Leave a comment

What’s the difference between Task.ContinueWith and await?

In the .NET there are many ways to implement asynchronous programs. We can use the Task, Task<T> or await keyword to write asynchronous programs. For Example: Task<IPAddress[]> addresses = Dns.GetHostAddressAsync(“msdn.com”); addresses.ContinueWith(parameter =>      { IPAddress[] ipAddresses = addresses.Result; }); As … Continue reading

Posted in .NET, .NET 4.5, C# 5 | Leave a comment

My Advices for Parallel and Async programming.

The biggest reason I’m writing this post, is when I started to write async and await pattern,there were few questions about this pattern, and this post going to explore them. What is the difference between Parallel and Async? To answer … Continue reading

Posted in .NET 4.5, C# 5 | Leave a comment

Little Difference between c#4 and c#5 compiler

What is the difference between outside declared variable and inside declared variable? Case1: Outside: var i_ = default(int); foreach (var i in new[] { 0, 1, 2, 3, 4, 5 }) { i_ = i; Console.WriteLine(i_); } Inside: foreach (var … Continue reading

Posted in C# 5 | Leave a comment