About choosing integer or GUID as a primary key, Well both implementations have their advantages and disadvantages. It' completely dependent on your database design, migration needs and overall architecture. let's discuss...

When to use GUID?

You can use GUID as primary key if your application's database is too complex and you use replication and distributed tables or you want to merge tables of your database. GUID is the unique in the world! and it generates randomly (not by mac address of the network lik

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. <