C# namespace - Namespaces in c# - c# - c# tutorial - c# net



What is C# namespace

  • Namespaces provide a way to uniquely identify a type
  • Provides logical organization of types
  • Namespaces can span assemblies
  • Can nest namespaces
  • There is no relationship between namespaces and file structure (unlike Java)
  • The fully qualified name of a type includes all namespaces
learn c# - c# tutorial - c# namespace - c# examples -  c# programs
  • The using statement lets you use types without typing the fully qualified name
  • Can always use a fully qualified name
  • learn c# - c# tutorial - c# namespace - c# examples -  c# programs
  • The using statement also lets you create aliases
  • learn c# - c# tutorial - c# namespace - c# examples -  c# programs
  • Best practice: Put all of your types in a unique namespace
  • Have a namespace for your company, project, product, etc.
  • Look at how the .NET Framework classes are organized
  • To use certain features .Net we can import the namespace into our ASP.Net page
  • For example, if you want to access an SQL database from a web page you would import "System.Data.SQLClient"
  • learn c# - c# tutorial - c# import namespace - c# examples -  c# programs

    Related Searches to C# Namespace