0% found this document useful (0 votes)
4 views9 pages

Questions

Asp.net is a server-side web application framework for developing various types of applications. It incorporates object-oriented programming principles and solid design principles to create maintainable and understandable code. The document also covers key concepts such as page life cycle, token-based authentication, extension methods, and various programming constructs in C#.

Uploaded by

av859669
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

Questions

Asp.net is a server-side web application framework for developing various types of applications. It incorporates object-oriented programming principles and solid design principles to create maintainable and understandable code. The document also covers key concepts such as page life cycle, token-based authentication, extension methods, and various programming constructs in C#.

Uploaded by

av859669
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

what is Asp.net?

Asp.net is server side web application framework design for web


development technology like windows app, web app, console app like
this.

OPPS: is aobject oriented programming language that have contains


list of element that element make object oriented programming
stronger like
1) object 2) class 3) Encapsulation 4) Association 5)polymorphysum
6) Abstraction
1) Object: object are basic runtime entities in object oriented
programming they may be represent person place any iteam the
program has handle.

2) class: class is data structure that contains DataMember (like


constant, file, event) & member function (property, constructor,
destructor)
3) Encapsulation: wrapping a data and function into single unit is
known Encapsulation. Encapsulation is implemented using access
specifier.
4) Abstraction: Is hidding unwanted data and giving the relevant.
5) Inheritance: it give facilities reuse code one class to onother
class.
6) Polymorphysym: give facilities abilities to take more than form.
there are two types of Polymorphysym.
1) compiletime Poly: Method Overloading-method with same
name but diffrent Arguments.
2) Runtime Poly: Method Overriding - Method Name and
signature must be same.

Solid Principle:
Is used to building great solution make it easy to maintain,
Understand code, easy to modify code.
1) Single Responsibility: Class should have one reason to change.
Ex: Consider Email Sender class that sends mail. It responsible is to
send mail only.
2) Open Close: here you should be able to add new functionality
without changing existing code.
Ex: Suppose using Interface and inheritance you can create like
Account Interface and Class Personal Account, Saving Account that
implemented later also If you wanted add new Account as well.
3) Linsknov subtitution: You should able to use any dervied class
instead of base class without modification.
4) Dependancy Inversion: High level class should not depends on
low lavel class inited of both should depends abstraction.
5) Interface segrigation: client should not be fource to use an
interface which is not relevent to it.

Page life cycle:


Means life cycle of each page in asp.net.
When asp.net page run the page goes throught a life cycle in that
time perform sieries of processing steps:
1) Start of page: set request response object.
2) Init: Initialise page controls and apply them.
3) load: Ispostback, load control, properties
4) validate: Validate page and controls.
5) Render: save view state, Render control
6) Event Handling: 7) Unload: Freeing up of memory

Generic:
Means general form, not specific c# allow to define generic class,
abstract class, field, method, properties, event and operator using
type parameters and without specific data type. typeName<T>

IEnumerable: Its suitable for iteration. Ienumerable bring all data


from server to client then filter them as
Ex: select from table where id> 10 like this.
IQueryable: whenever we encounter huge data with so many
records, we reduce overhead from application. filter is apply in
database side.

Token Based Authentication:


Token based Authentication How its work->
1) when The client send request with credentials
(Username/password) to authentication server
2) The server verifies the credentials and issue a token
(eg: Jwt-Json web Token)
3) The client store the token, usually in local storage or Cookies
4) for subsequent request the client includes the token in the
authentication header.
5) The resource server validate the token. if valid the request
process otherwise denied.
JWT token is basically combination 3 things:
1) header: header provide metadata about types of data we have.
2) Payload: Represent actual information.
3) signature: Its Json web signature. Its veryfying Intigrety of the
data transefer over var.

What are Extension Methods


Extension Method allows us to add a new method to an existing
class:
Without modifying it or adding code
Without extending it or creating a new derived type
Without recompiling the class

Absract class : (Use to avoid code duplication / repeatation)


A.C is special Kind of class that has no Implementation. it can be
initiaated. A.C does not support inheritance.

Static class : There are two main features of static class:


1) No Object of S.C can created.
2) Static class contain only static Members.
All members can be accessible with its own name.

Constructors:
is special method of a class which will invoke automatically
whenever object of class is created. Constructor are responsible for
object initialization a memory allocation of its class.
1) Default Constructor: It is without any parameters.
2) Parameterized Constructor: It has one parameter
3) Copy Constructor: It creates an object by copying variables from
another object.
4) Static Constructor: It is created using a static keyword and will be
invoked only once for all of the instances of the class.
5) Private Constructor: It is created with a private specifier and does
not allow other classes to derive from this class or create an
instance of it.

Generic Collection:
Generic means : hold same Data type.
Ex: List , Dictionary, Stack, Queue
No-Generic : Hold any Data Type
Ex: ArrayList, Hash Table

Abstraction Encapsulation

Solve problem
Solve problem in design level
implementation level

hiding the code and data


Abstartion is used for hiding the unwanted data into
and giving you relevent data single unit to protect the
data

EX: Inner implementation


for mobile
phone like how disply,
Ex: Outer look of mobile phone,
screen &
keyboard is interaction
each other.

Interface Abstract Class

Interface is not class Abstract is class


A.C accepts all access
Interface access Public
modifier

A. C contains Method,
Interface can only contain method fields, constant
Interface

Method Overloading Method Overriding


Method must have same
Method must have same
signature. Means same name
name but
and same
different parameters
parameters.
when error occurred it can be
caught Error caught at Runtime.
at compiletime

String String Builder

String is Immutable (Unable to


Mutable (able to change)
change)

String we don't have Append


we can use Append Keyword
keyword

String belongs to
S.B Belongs to sytem.text
system.namespace

Var Dynamic

Variable are declared using var variable are declared using


keyword dynamic
are statically type. keyword are dynamic type.

If varible not initialise it throw


Not throw error
Error
Ex: var abc 10; // statement 1 Ex: dynamic abc-10;
abc="dinesh"; // abc-"DK";

Abstrat class Sealed class

S. C can not used as base


A.C can used as a base class
class

S.C can not contains any


A. C contains Abstract methos
Abstract Method

can not contain any virual


A.C conatains Virtual methods
Method

Primery key Foreign key

1) Uniquely identifies each record in 1) Create relationship between two


table table.

3) Never accept Null Value 2) Accept multiple Null Value.

3) Multiple Foreign key in able


4) Single Primery key in table
4)while insertin value in F.Key table
5) No limitation in inserting the value
esure all value should present column
into
in PK
Array Array List

Strong type means stored only


Stored any type of Item
specific type

Array Can not accept Null Value Accept Null Value

Memory has fixed size and can not


incread Size can be Increase or decrease
or decrease

View State Hidden Field

1) view State not able to change


1) Possible to change value client
value by
side.
client side code.
2) H.F. Not Encrypted Formate
2) view state is Encrypte Formate.

Session state Application State

1) Variable Available across page but


1) Variable Available across all
given
session.
single session.
2) Multiuser global data.
2) Single user global data.

Delete Truncate

Remove some or All of the Record


Delete Entire rows from table
from table

we can use Where clause We can not use Where clause


Delete record does not reset Identity Reset Identity

You can RollBack Data You can not RollBack Data

Trigger Procedure

Implicitly invoked when any event


Explicitly called by user using
such as
statement
Insert ,update, delete occured

we can not return value in trigger we can return 0 to n values

Primery key Foreign Key

Uniquely Identifues each record in a F.K is column that create relationship


table btwn table

can not accept null Value Accept Multiple Null Values

Only one key for table Multiple F.K in a table

Primery key Unique Key

Uniquely Identity each Record in a


Uniquely Identity each Record in a table
table

P.K cannot have Null Value Unique constraint may have Null Value

Only one P.K in a table More than one unique constraint

Cluster index Non cluster index

Drop Truncate

Remove table Only delete row not structre of table

second Highest salary:


select * from emp e1 where 2 = (select count(distinct(salary)) From
emp e2 where e2.emp >= e1.emp)

Find Duplicate Record in table :


select EmpName, salary,count(*) as cnt
from EMP GroupBy EmpName,salary
Havingcount(*)>1

You might also like