You are on page 1of 2

Object Oriented programming is a programming style which is associated with the

concepts like class, object, Inheritance, Encapsulation, Abstraction, Polymorphism.

Class. A class is a collection of method and variables. ...


Inheritance. ...
Objects. ...
Abstraction. ...
Encapsulation. ...
Polymorphism.

Difference between Dispose & Finalize Method


Dispose
It is used to free unmanaged resources like files, database connections etc. at any
time
Explicitly, it is called by user code and the class which is implementing dispose
method, must has to implement IDisposable interface.

Finalize
It can be used to free unmanaged resources (when you implement it) like files,
database connections etc. held by an object before that object is destroyed.

Internally, it is called by Garbage Collector and cannot be called by user code.

Generics
Generic is a class which allows the user to define classes and methods with the
placeholder. Generics were added to version 2.0 of the C# language. The basic idea
behind using Generic is to allow type (Integer, String, � etc and user-defined
types) to be a parameter to methods, classes, and interfaces.

Different Types Of Action Results In ASP.NET MVC - C# Corner

Routing in MVC
In the ASP.NET Web Forms application, every URL must match with a specific .aspx
file. For example, a URL http://domain/studentsinfo.aspx must match with the file
studentsinfo.aspx that contains code and markup for rendering a response to the
browser.

Route

Route defines the URL pattern and handler information. All the configured routes of
an application stored in RouteTable and will be used by Routing engine to determine
appropriate handler class or file for an incoming request.

Configure a Route

Every MVC application must configure (register) at least one route, which is
configured by MVC framework by default. You can register a route in RouteConfig
class, which is in RouteConfig.cs under App_Start folder. The following figure
illustrates how to configure a Route in the RouteConfig class .

Register Routes

Now, after configuring all the routes in RouteConfig class, you need to register it
in the Application_Start() event in the Global.asax. So that it includes all your
routes into RouteTable.
Routes can be configured in RouteConfig class. Multiple custom routes can also be
configured.
Route must be registered in Application_Start event in Global.ascx.cs file.

-------------------------------------------------------Desgin
Pattern--------------------------------------------------

There are 23 design patterns, also known as Gang of Four (GoF) design patterns.
These 23 patterns are grouped into three main categories based on their:
Creational, Structctural and Behavioral

1.Factory Pattern: Creational pattern


Factory design pattern is used when we have a super class with multiple sub-classes
and based on input, we need to return one of the sub-class.

The Factory Method defines an interface for creating objects, but lets subclasses
decide which classes to instantiate

2. Singleton Design Pattern


The pattern ensures that only one object of a specific class is ever created. All
further references to objects of the singleton class refer to the same underlying
instance.

There are situations in a project where we want only one instance of the object to
be created and shared among the clients.

You might also like