How to create UrlSlug in Asp.Net MVC

UrlSlug Is a way of generating a valid Url, and using the title of an article to generate a URL. UrlSlug is very important in CEO because google likes to index the meaningful Urls at the first and then it refers to other Urls. Spouse you wanna to create the this Url:


create the model class :

  1.     public class Blog
  2.     {
  3.         public int Id { get; set; }
  4.         public s... Continue

Disadvantages of n-layered architectures

Most of the people use n-layered architectures in their application developement. There are lots of advantage for n-layered architecture but I want to talk about disadvantages. actually it's not a good idea to design a somplex architecture for every problem , you don't need to apply n-layered architecure in every case because it's mostly about making complex things simple whilst a complex architecture can make a system more and more hard to understand rather than making performance problems. Based on this pr... Continue

Difference between layer super type and template method patterns

About two days ago I asked a question about the differences of these two patterns. after reading about the template method patterns in detail I found that although there are lots of similarities between them but layer super type is not the same as method template and vice versa. I've blogged about Layer Super type before in here, now I want to talk about method template pattern. Basical... Continue

Domain Driven Design alphabet

I'm too young to talk about Domain Driven Design , and This article is about what I've learned from Domain driven design by reading the resources that you can see at the end of this article .


  1. Introduction
  2. What is DDD ?
  3. Why DDD ??
  4. Domain Model and Subdomain
  5. Ubiquitous language... Continue

What's the meaning of POCO entity and Persistence ignorance

POCO which stands for "Plain Old CLR Objects" is an entity/class and doesn’t depend on any specific base class. It is like any other Dot net class you have seen before. These POCO entities (also known as persistence-ignorant objects) also support most of the same LINQ queries you use in you Data access layers for your business objects.  POCO is a simple object to be used with a complicated, special object framework such as an ORM component. In other definition POCOs are entities of your domain, so When you use enti... Continue

Apply to request response pattern in your service layer

Messaging pattern is one of my favorite patterns to use in service layer! since I've read Pro Design pattern by ScottMillett I've been a big fan of patterns and how to apply them, in this article I'm going to talk about request response pattern.

"Design patterns that are associated in the realm of large-scale distributed applications like SOA systems are often referred to as Messaging patterns. Messaging patterns... Continue

Introducing Z.bulkOperation

Today I was tackling with a problem. It was about inserting and updating 200000 records of data. I just wanted to find a solution rather than writing Store Procedure. I just searched on the web and found a library named Z.BulkOperation

I dare say I had never seen handling this amount of data nicely in application level without even using a line of SQL code, it's awesome!

Fire up visual studio and a simple console or MVC application and install the package via:

PM> Install-Package Z.BulkOperations

PM> Install-Pac... Continue

Repository Pattern practice in data access layer via entity framework

To read about definitions of Repository patter refer to here or here and then let's begin! I'm gonna to show the using of repository pattern with entityframework in Data access layer. Sorry about the example because it's about product , category , brand , blah blah again! First of all create an interface called IAggregateRoot

  1.    public interface IAggregateRoot
  2.     {
  3.     }
  4. <... Continue

ActionResult types in MVC

Controller actions returns the ActionResult and it's possible to return kinds of results based on what we want in the output , let’s consider for types of result in by example in this article.

ActionResult: it just Initializes a new instance of the ActionResult class. ActionResult is the base class for other types of action.

  1.         //Action Result
  2.         public ActionResult Index()
  3.         {
  4. &nbs... Continue

How to get CPU Id by using C# with .Net classes

By using ManagementObjectSearcher class in System.Management; namespace you can get your hardware information such as CPU Id. take a look at this piece of code:


  1.        static void Main(string[] args)
  2.         {
  3.             var managementObjectSearcher = new ManagementObjectSearcher("SELECT ProcessorId FROM Win32_Processor");
  4.             var oCollection = managemen... Continue