June 8th, 2013

C# LINQ: Combine Multiple Sequences In Parallel

In this article, we will see how to join multiple arrays, lists or collections by order with LINQ. In other words, we can say Zip operation on multiple sequences. Assuming we have following arrays:

            int[] numbers = { 1, 2, 3 };
            string[] abc = { "a", "b", "c" };
            string[] pqr = { "p", "q", "r" };
            string[] xyz = { "x", "y", "z" };
            string[] words = { "one", "two", "three" };
June 5th, 2013

Realtime Wall Post and Comment Notifications using SignalR and Knockout

In my previous post, we created Facebook style wall posts and comments system. In this post, we will implement real time notification when any new post or comment is added and display it on notification click using Knockout JS and SignalR. You might think .. Why notification? Why not to display in real time? If we display it in real time, It will irritate users. Suppose you are reading a post middle of the page, suddenly few new posts appear on top then the post you are reading go down and you have to scroll down to find where it is. That’s why in twitter or Stackoverflow,the notification is used when any new post is arrived and you can check them on notification click. We will implement the same thing for both posts and comments.

June 2nd, 2013

Facebook Style Wall Posts and Comments using Knockout.js and ASP.NET Web API

In this article, we will implement Facebook style wall posting with following features using Knockout.js, jQuery and ASP.NET MVC 4 with Web API.

1. Add new post and display the latest post first
2. Add new comment to post
3. Display date time in fuzzy time stamps (e.g. 5 mins ago..)
4. Auto-grow textarea for long posting and commenting
5. Comment link to toggle comment box
6. Display user avatar for posts and comments