Friday, December 3, 2010

default access modifier in c#

internal


 public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.
private
The type or member can be accessed only by code in the same class or struct.
protected
The type or member can be accessed only by code in the same class or struct, or in a class that is derived from that class.
internal
The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal
The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.

Reference:
http://msdn.microsoft.com/en-us/library/ms173121.aspx

MVC pattern


Reference:

keys

Primary key
  • an attribute/column which uniquely identifies a record
  • primary key can be column/combination of columns
  • primary key cannot have null values

Candidate key

  • Candidate key is a column which is not a primary key, but it can qualify as a primary key
  • there can be multiple candidate key in one table

alternate key

  • any of the candidate key that is not part of primary key