Export Collection of data to Excel in c# using Closed XML

ClosedXML is a .NET library for reading, manipulating and writing Excel files.  ClosedXML is a fine library for exporting data to Excel. It is very simple to use and fast enough for smaller sets of data. Firstly you have to add reference to ClosedXML. Install ClosedXML using NuGet Package Manager. Using ClosedXML you can set … Continue reading Export Collection of data to Excel in c# using Closed XML

Mock HttpContext using moq Framework

Moq is a framework that allows us to simulate dependencies at test time and monitor how our system under test interacts with them under various circumstances. Mock objects allow you to mimic the behavior of classes and interfaces, letting the code in the test interact with them as if they were real.  In a project … Continue reading Mock HttpContext using moq Framework

Parallel.ForEach() Vs Foreach() Loop in C#

Foreach Loop Foreach loop runs upon a single thread and processing takes place sequentially one by one. Foreach loop is a basic feature of C#.  Its execution is slower than Parallel.Foreach in most of the cases. Syntax foreach( var item in list){          DoFunction(item); } The problem with this foreach is that item 1000 has to wait until … Continue reading Parallel.ForEach() Vs Foreach() Loop in C#

SignalR: Call client methods from Custom ActionFilter class and Publish messages (Render MVC View as a string) to all subscribed clients

Sometimes we would like to perform certain action before or after a particular operation, or some times we need a pre or post action behaviors from action, for achieving this functionality ASP.NET MVC provides a feature called Filters. Action filters are used to implement the logic that get executed before or after a controller action executes. … Continue reading SignalR: Call client methods from Custom ActionFilter class and Publish messages (Render MVC View as a string) to all subscribed clients

Introduction to AngularJS

AngularJS is a client-side JavaScript MVC (Model-View-Controller) Framework meant for implementing Single Page Architecture (SPA), maintained by Google. It helps to build web applications. Core Features Following are most important core features of AngularJS − Data-binding − It is the automatic synchronization of data between model and view components. Scope − These are objects that refer … Continue reading Introduction to AngularJS

Coding standards and Naming conventions

This post will helps you to understand basic coding conventions. A consistent naming pattern is one of the most important elements of predictability and discover-ability in a managed class library. Purposes of coding conventions They create a consistent look to the code, so that readers can focus on content, not layout. They enable readers to … Continue reading Coding standards and Naming conventions

NLog

NLog is a free logging platform for .NET,  NETSTANDARD,  Xamarin,  Silverlight  and Windows Phone with rich log routing and management capabilities.  NLog makes it easy to produce and manage high-quality logs for your application regardless of its size or complexity. NLog is an open source library distributed at no cost under the terms of the … Continue reading NLog