KEMBAR78
Sarthak Notes | PDF | Class (Computer Programming) | Programming
0% found this document useful (0 votes)
56 views51 pages

Sarthak Notes

The document outlines a 3-tier architecture application using MVC for the presentation layer, Web API for the business layer, and SQL for the database layer, with a focus on various design patterns and principles such as dependency injection, singleton pattern, and repository pattern. It covers topics like exception handling, content negotiation, and unit testing, as well as technical concepts like serialization, boxing, and the use of Entity Framework. Additionally, it discusses security practices, data storage options, and the importance of design principles like SOLID in application architecture.

Uploaded by

sarthak shah
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)
56 views51 pages

Sarthak Notes

The document outlines a 3-tier architecture application using MVC for the presentation layer, Web API for the business layer, and SQL for the database layer, with a focus on various design patterns and principles such as dependency injection, singleton pattern, and repository pattern. It covers topics like exception handling, content negotiation, and unit testing, as well as technical concepts like serialization, boxing, and the use of Entity Framework. Additionally, it discusses security practices, data storage options, and the importance of design principles like SOLID in application architecture.

Uploaded by

sarthak shah
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/ 51

PROJECT ARCHITECTURE

My application has 3 tier architecture


In that we have use mvc as Presentation layer
web-api as Business layer and sql as a database
Layer. The mvc layer communicates with web api
layer for that we have used repository pattern to
call api’s
When api gets requested from the mvc layer the
api repositories interacts with the database layer
All the calls from mvc layer are transferred to the
database through the api project
The api project which is hosted on internal server
of my client and only the mvc layer is visible to
external user
ROLE IN PROJECT
In our application basically I worked on all
different layers
I worked on database mvc and web-api .in
database I worked on table design writing stored
procedure in mvc I worked on form
authentication validations consuming web api in
controller.in web api I worked on the writing
methods for accessing data from database
and also testing of api methods using postman
FIRST AND FIRSTDEFAULT
First will throw exception if there is no result data
for the supplied criteria whereas first default will
return the default value if there is no result data
DEPENDENCY INJECTION
Dependency injection is a design pattern to
implement the dpedency inversion principle says
that high level module should not depends on low
level module but they should depend on abstract
class or interface this depdency inversion principle
we can implement using dependncy injection
design pattern various types to implement we
have multiple ways we can inject the dependency
using constructor we can using property
1. public interface text
2. {
3. void print();
4. }
5. class format : text
6. {
7. public void print()
8. {
9. Console.WriteLine(" here is text format");
10. }
11. }
12. // constructor injection
13. public class constructorinjection
14. {
15. private text _text;
16. public constructorinjection(text t1)
17. {
18. this._text = t1;
19. }
20. public void print()
21. {
22. _text.print();
23. }
24. }
25. class constructor
26. {
27. static void Main(string[] args)
28. {
29. constructorinjection cs = new constructorinjection(new format());
30. cs.print();
31. Console.ReadKey();

SINGLETON PATTERN
Singleton design pattern is gives us the you know
so basically whenever there is a need that we
want only single object of a class throughout the
application then we can use singleton design
pattern

CONTENT NEGOTIATION
Content negotiation is the mechanism that is used
for serving different representation of resource to
the same URI to help the user to specify which
representation is best suited for the user for
example which document language, which image
format.

REMOTE VALIDATION
We have multiple validations attributes in mvc if
we want to validate same input based on
database value or server values then we can use
this remote validation , remote validation works
with ajax it will hit the server for validation
without re-loading the page

MODELBINDING / MODELBINDERS
Whatever the values are passed by views to the
action method at the time of retrieving those
values passed from view to action method model
binder helps us to retrieve those values
CONSUME WEB API IN MVC
To consume Web API in MVC we can use
HttpClient class in MVC controller.
HttpClient sends a request to the Web API and
receives a response.
Then we can convert response data to a model
and then render it on a view.

OAUTH
Open authentication is a type of token
authentication it allows an end users account
information used by third party services such as
Facebook without exposing users username and
password.

SERIALIZATION AND DESRIALIZATION


Serializatin means converting dot net object into
any message format.
Deserializatin means converting any message
format into dot net object.
BOXING AND UNBOXING
Converting value type to reference type called
boxing. This is an implicit conversion.
int i = 10;
object o = i;
Converting reference type to a value type called
unboxing. This needs an explicit cast.
object o = 100;
int j = (int) o;

STATIC CONSTRUCTOR
Static constructors are used to initialize static
fields of a class.
Static constructors are called only once regardless
of how many instances of the class are created.

STATIC CLASS
Static class provides centralized and maintainable
approach. static class can only contain static
data members, static methods, and a static
constructor.It is not allowed to create objects
of the static class. Static classes are sealed,
you cannot inherit a static class from another
class

DEADLOCK
Deadlock occurs when two or more processes lock
the separate resource

ANON TYPE
Anonymous type basically type without name. to
handle the anonymous type we use var keyword

ANON ATTRIBUTE
In mvc we have a attribute called as allow
anonymous attribute. which can use if we want
access action method without authentication
without authorization at that time I have seen
anonymous attribute
SP
Stored procedure helps us to reduce network
traffic . helps us to reduce sql injection.

MAGIC TABLE
We have magic table like inserted or deleted
which we use inside a trigger. we call them
magical tables because we don’t insert record into
them record gets automatically inserted or
deleted

ORM
stand for object relational mapper. this
technique used for converting data between c#
object and relational database

CURSOR
A cursor in SQL is a temporary work area
created in system memory. when a SQL
statement is executed.
We can use if we want to operate the table row
by row basis . cursor are not good for
performance

CORS
Cross origin resource sharing is a browser security
feature that restricts cross origin http request that
are initiated from scripts running in the browser.
if our rest api receives non simple cross origin http
request you need enable cross support

SOLID PRINCIPLE
Solid principal gives us some standard way to
design better application architecture
Solid is acronym
S -for single responsibility , o- for open close
principle , l – for lyscom principle , I – interface
segregation , d – for dependency segregation.

CLR
Comman language runtime clr managed
execution environment that is the part of .net
framework

GARBAGE COLLECTOR
The garbage collector manages the allocation and
release of memory.

SEALED CLASS
Sealed class can not get inherited consider we
have two classes base class and derived class
Base class is seled class then sealed class can not
get inherited by the derived class .

EXTENSION METHOD
Extsion method allows us to add new method in
existing class or in the structure without
modifying the source code of the original type
namespace Program {
public static class Demo {
public static int myExtensionMethod(this string str) {
return Int32.Parse(str);
}
}
class Program {
static void Main(string[] args) {
string str1 = "565";
int n = str1.myExtensionMethod();
Console.WriteLine("Result: {0}", n);
Console.ReadLine();
}

ENUM
We can replace integral constants using enum
Advantages - code readable , maintainable
LAZY LOADING
Loading data on demand
MVC LIFECYCLE
A mvc lifecycle is a series of steps or events used
to handel some type of request or change an
application state
ROUTING WEB API /MVC
Web api routing is similar to the asp.net mvc
routing .it routes on incoming http request to a
particular action method on a web api cantroller
RANK FUNCTION
Ranking function we use to give the row number
or rank to the table. we have different types of
ranking functions like row number, dense rank
and entile function all ranking functions works
differently

YIELD KEYWORD
Yield keyword helps us to do custom stateful
iteration over .Net collections. We can customize
iteration through a collection without creating a
temporary collection. Which will helps us to save
some memory.
TUPLE
A tuple is an ordered sequence, immutable, fixed
size and of heterogeneous objects. Tuple can be
used as return type of a method where we cannot
use anonymous types as return type.
DELEGATE
Delegates are type safe function pointers.
Delegates allow methods to be passed as
parameters. Delegates are used to define callback
methods. Delegates signature should get match
with method signature that’s why it is called as
type safe.

EXCEPTION HANDLING
Exceptions are nothing but runtime unforeseen
errors of an application. It is always a bad practice
in showing yellow screen to end user which
contains some application specific information.
This information is meaningless for a normal user
whereas useful for a hacker to hack your
application. So it is always recommended to do a
proper exception handling.
INTERFACE
Interface is a contract that defines the signature
of the functionality. It looks like a class but has no
implementation. It has only empty definition of
methods, functions, events, and indexer. Interfacs
provide forced implementation
GENERICS
Generics help to separate logic and data type to
increase reusability.we can create a class whose
data type can be defined on run time.

GAC
GAC (Global Assembly Cache) is where all
shared .NET assembly resides.
The Global Assembly Cache (GAC) is a folder
in Windows directory to store the . NET
assemblies that are specifically designated to
be shared by all applications executed on a
system

UNIT TESTING
Unit testing is a component of test tdd which is
test driven development
Unit testing is the first level of testing which is
done by the developer to test small unit of source
code.
Unit testing is done by developer in our project
before we handover the project to the qa team.
we write the unit cases also . we are using n unit
framework for the unit testing
Egger loading
Loading data even if user not using the data

ATTERIBUTE BASE ROUTING


Using attribute base routing we get more control
over routing we can configure this routing on
action method and cantroller lavel
ABSTRACT CLASS
Astrc class is like a normal class but in abstract
class we can write the abstract methods also
abstract class can also have constructors .we can
not create object of abstract class
PARTIAL AND RENDER PARTIAL
Partial and render partial method we used to
render partial view on the main views so there is a
difference between partial and render partial
method partial method returns the mvc html string
so whatever the partial view content is there it will
be written on the browser by the main view
whereas render partial method returns void and
whatever the partial view content is there it will
directly return on the browser itself so render
partial is faster than the partial method

PARTIAL VIEW
Part of page if I want to create some part of page
on our main page . partial view are mainly use for
reusability and maintainability. partial view we
can render on another partial method and on
main view also.Partial view returns mvc html
string
PARTIAL CLASS
Using partal class we can split class into multiple
physical files for example entity framework in
entity framework whatever models get generated
those are partial classes.partial class is created
using a partial keyword

STRING AND STRING BUILDER


Strings are immutable where as string builder we
can optimize the memory
ANTIFORGERY TOKEN
Antiforgry token we use for cross site scripting
attack . antiforgry token we usually give to the
post type action methods so which actually
ensures the security that there will not be any
cross site scripting attack
USE EF WHICH APPROCH IS BETTER
Ef it's orm base and it has benefits over our
traditional way of writing ado.net code for
database communication ef gives us multiple
approaches like database first approach, code first
approach, model first approach we have used
database first approach but code first approach
has many advantages over database first
approach because using code first approach we
can implement domain driven design where we
can design all our classes and from those classes
we can design the database schema
CTS
Common Type System (CTS) describes the
datatypes that can be used by managed code.
CTS defines how these types are declared,
used and managed in the runtime. It facilitates
cross-language integration, type safety, and
high-performance code execution
EVENTS
event fires with some action. in ASP dot net also
we have a multiple types of events like for
example page level events, control level
events,application level events similarly in
JavaScript we have the events like on click on
mouse over on mouse event so we have all
these type of of events in dot net
XSS ATTACK
is a security attack in which user enters a
malicious code when entering data in the input
form.
This code is a JS or any other scripting
language code.
And when this code runs on browsers then It
attack on the data.
REF AND OUT
Ref and out keyword we use with the method
parameters ref and out keyword basically we
use if we want to reflect the parameter
changes in the calling method also so when
we use ref in that case it's mandatory that we
should initialise the value before calling that
method and whereas in out keyword it's not
mandatory but in out keyword is mandatory to
assign the value in the called method before
control leaves it
REPOSITORY PATTERN
we have used entity framework and for entity
framework we have the db set properties and
whenever we want to communicate with the
database we need to use those db set
property to make them common because in
our project also if I want like list of farmers or
if I want to see list of blogs posted by the
sellers so in that case we are using the db set
property we have created the repository and
we have created a generic repository where
we are accessing any type of DB set property
using the single and similar methods that
because of that we have used repository
pattern in our project
PRIMARY KEY AND UNIQUE KEY
Prim and Unique both we use to enforce
uniqueness in the column primary key we can
create only one on the table unique key we
can create a multiple over the table primary
key does not allow null value whereas unique
key allow a single null value
LOCAL STORAGE AND SESSION
STOAGE
local Storage and session storage both we
use to store data on browser site and the
difference is that local storage value will be
there on browser for longer time and
whereas the session storage data will be
there till that particular session only I mean if
we close the browser it will clear out that
session storage data and local storage data
will be there till the time we explicitly clear
that value

VIEW PORT
The viewport is the user's visible area of a
web page. The viewport varies with the
device, and will be smaller on a mobile phone
than on a computer screen

WHY ENTITY FRAMEWORK


ef improves and help the developer writing
code in in minimum time. increases the
productivity of a developer and also in entity
framework we have lots of advantages lots of
multiple approaches like database first
approach ,code first approach ,model first
approach and using these benefits we can
have more control than the traditional ado.net
code so because of that reason we have this
entity framework
CONSTRUCTORS
constructor is a special method which is
invoked automatically at the time of object
creation.
DEFAULT CONSTRUCT
A construct has not defined any parameter or
we can say without any parameter is called
construct . it intilizes the same value of every
instance of class
Class program {public program(){}
Static void Main(string[]args)
{Program p = new Program();
Console.ReadLine();}

PARAMETERIZED CONSTRUCT
A construct which has at least one parameter
is called parameterized construct.using this
type of construct we can initialize each
instance of the class to different values
Class Employee{
Int EmpId;
String EmpName;
Int EmpAge;
Public Employee(Int EmpId, String EmpName,
Int EmpAge)
{
this EmpId = EmpId;
this EmpName = EmpName;
this EmpAge = EmpAge;
}
Static void Main(string[]args)
Employee Sarthak = new
Employee(11,”Sarthak”,24);
Console.ReadLine();}
COPY CONSTRUCT
The construct which creates an object by
copying variables from another object is called
a copy construct . the purpose of copy
contruct is to initialize a new instance to the
value of existing instance
PARAMS
Param is an important keyword in C#. It is
used as a parameter which can take the
variable number of arguments
namespace AccessSpecifiers
{
class Program
{
// User defined function
public void Show(params int[] val) // Params Paramater
{
for (int i=0; i<val.Length; i++)
{
Console.WriteLine(val[i]);
}
}
// Main function, execution entry point of the program
static void Main(string[] args)
{
Program program = new Program(); // Creating Object
program.Show(2,4,6,8,10,12,14); // Passing arguments of variab
le length
}

EXCEPTION WEB API


In our Project we have a global exception handling
and for Web API we have created custom
exception filters and using that custom handler we
are logging all our application errors in the
database for the troubleshooting also we have
used this custom exception filter for every
controller API controller and along with that we
have the try catch block also and those are try
catch block within try catch block we are returning
we are using the methods like band request or not
found or create response method using these
methods we are returning the error codes status
codes and the response to the client

EXCEPTION MVC
We can use try catch block to handle the
exceptions but in mvc we have a filter concept
we have exception filter so we can use that
handle error attribute handle error filter to
handle the exception but in our project we
have done with the global error handling we
have created our own custom filter
implementing the exception filter and so all
type of exceptions are handled by that
particular custom handle error attribute which
we have created

TRIGGERS
triggers gets automatically fired. against the
command against the action with whom we have
created that trigger we have different types of
triggers basically dml triggers, ddl triggers triggers
triggers are very useful execute query without
actually writing them without actually calling them.
triggers has lots of advantages basically because
don't need to call the trigger explicitly also in
trigger we have a magical table inserted and
deleted using we can get those data which is
going to be deleted or inserted from the table

INDEX
Index helps the query to run faster we have
two types of index method cluster and non
cluster index we can create only one clustered
index but we can create multiple non
clustered index over the table
MEDIA TYPE FORMATTER
Web API supports multiple message formats so
if we want to configure our API for particular
message format for communication then we can
use a media type formatter by default Web API
support Jason and XML format but if we want to
customize then we can create our own custom
media media type formatter also
LOOP
Loop allows you to execute a single statement
or a block of statement repitatively
ABSTRACT CLASS
The abstract keyword is use to create abstract
class . an abstract class is incomplete and
cannot be instantiated an abstract class can
be used as base class. An abstract class
cannot be sealed
DYNAMIC KEYWORD
dynamic keyword checks the type at runtime if
we have any type which we are not sure in
compile time then we can use dynamic
keyword this will check type in runtime so
compiler will not give us any error
INHERITANCE
inheritance allows us to transfer common
attributes and methods of existing class
transfer common attributes and methods from
parent class to child class .inheritance
provides re-usability by allowing us to extend
an existing class
BUNDALING
Bundaling is a technique to improve
performance by reducing the number of
request to the server instead of a fetching all
resources one by one we can create a bundle
and featch that bundle in a one single request
MINIFICATION
Minification performs a variety of
different code optimizations to scripts or
css, such as removing unnecessary
white space and comments and
shortening variable names to one
character.

PRIVATE CONSTRUCTOR
Private constructor is a special instance
constructor which is used in a class that
contains static member only.
when we use private constructor inside a
class then we cannot create the object of that
class then anywhere in the application
basically it restricts due to inaccessibility.
private constructor or we mostly used to
implement the singleton design pattern
SIMPLE CONSTRUCTOR &
TYPES
A special method of a class or a structure in
object oriented programming language that
initialise a newly created object of that type

TYPES of constructors copy constructor


static constructor private constructor and
default constructor

AREA
An area is a small unit of mvc web application
which has the same folder structure model,
view ,controller, as the actual application area
provide a way to partition a large asp.net mvc into
smaller functional groupings if our application is
made of multiple high level functional components
that should be logically separated if I want to
partition in our mvc projects that each functional
area can be work independently when I want to
separate modules to maintain the application and
in asp.net mvc we can have any number of areas
which area has its own control models and views.
in larger application each team can work
independently .area is easy to manage and easy
to read

WEB AIP
API stands for application programming
interface Web API allows user to access a
particular resource using we can build web
pages in different technologies
AJAX HELPERS
Ajax helpers works asynchronous on
view.these are use to get,post data from
controller without refreshing entire page .
ROUTING
Routing is a pattern matching system routing
Match incoming request to particular request
each incoming request is mapped in the route
table

CONVENTIONAL ROUTING
Conventional Routing is a pattern matching
system for URL that maps incoming request
to the particular controller and action method.
We set all the routes in the RouteConfig file.
RouteConfig file is available in the App_Start
folder. We need to register all the routes to
make them operational
ATTRIBUTE ROUTING
As the name implies, attribute routing means
attributes are used to define routes. The
Attribute routing provides more control over
the URIs in our Web API application by
defining routes directly on the actions and
controllers

MVC ARCHITECTURE
Mvs stands for Model views and controllers the
user is requesting user always request to an action
method of controller and then whatever the data or
validation part is there it is done in the model and
then if we want to return the UI so that logic and
controls will be handled by views so the main
request goes to action method of controller action
method takes the data from model it use that
database review and then view returns that html
response which we display on the browser

WCF AND WEB API


Both techniques are used to create the services but
there are few differences between them using wcf we
can create soap based services as well as restful
services using wcf supports multiple protocols and
multiple message formats wcf has multiple hosting
techniques we can install the wcf service as a
windows service also whereas if we come to Web API
so using Web API we can develop only HTTP restful
services and other protocols are not supported in the
Web API we can we talk about the message format then
we have multiple media type formatter in the body which
we can use . API is easy to develop Web API is
lightweight our intention is to create restful service so
our first choice will be it will be web api

HTTPSRESPONSE AND
IHTTPACTION RESULT
both we can use to return the response from the
Web API method using http response message
we need to use create response or create error
response methods and we need to explicitly
provide the status code and the response while
returning from the method but using ihttpaction
result we have the methods like okay ,bad request
not found ,unauthorised so we can use this
method directly to return the response without
specifying the status code

RAZOR
Razor is a wave engine. using razor we can
create CSHTML pages and using cshtml
page is we can write C sharp code plus HTML
code
VIEW BAG VIEW DATA TEMP
DATA
View bag is a dynamic property collection
viewdata is key value pair collection temp
data is again a key value pair dictionary
collection we use viewbag and viewdata to
transfer the data from controller to view we
used temp data if we want to transfer the data
from one controller to another controller or
one action method to another action method
EXCEPTION GLOBALLY
If want to handle the exception globally then I
will create a custom exception filter and then I
will register that custom filter in the config file
so that whenever there is a unhandled
exception in any action method then
automatically my exception filter will get
invoked and it will basically help me to handle
exception so we can do the global exception
handling also
SQL INJECTION
sql injection is a attack there are some scenario
which user can inject and execute sum SQL
query from Ui and this can be occurred when
we have be in line queries when we directly use
the input values and use those values in the
query so this problem can be solved and
prevent by using parameterised query and using
stored procedure

COMMIT AND ROLLBACK


commit and Rollback these are the
commands we use with the transaction if all
the queries gets executed properly and if I
want to save that queries permanently
then I can use commit so that it will commit all
that data into the tables whereas if there is
some error occurred and i want to get my
previous state so in that case i can rollback
that transaction and whatever the queries are
executed as a part of transaction will get
reverted
ONINIT
The OnInit() function is the Init event handler.
It must be of void or int type, with no
parameters: void OnInit();

KEEP AND PEEK


Temp data template whenever we are
creating the temp data and if we access the
temp data value then it will automatically gets
cleared from the memory. if we want to
maintain the temp data value for the next
consecutive request in that case we can use
keep or peek methods. Peek function is used
to read the value without clearing it
AUTHENTICATION AND
AUTHORIZATION
Authentication and authorization both techniques
to provide security in the application authentication
is a process to identify the user credential so when
user is entering his username and password so we
can identify that whether that user is our website
user or not whereas authorization process comes
after authentication so if a user is authenticated
but we can check that whether that user is
authorised to access that resource are page or not
so authorization comes up after authentication so
in our application actually we are using forms
based authentication and for authorization we
have a roles based authorization

FILTERS AND TYPES


Filters are used to add pre or post logic to the
action method we can apply this filters on
action method or we can apply this filter at
controller level also we have a different types
of filters in mvc we have authentication filter
we have authorization filter we have action
filter we have result filter and exception filters
and all these filters have dedicatedly interface
so whenever we want to create any custom
filters then we can simply implement these
interfaces
DIFF UDF AND STORED
PROCEDURE
UDF(user defined function) only allows
inputs and not outputs.
Stored procedure allows for both inputs
and outputs.
Catch blocks cannot be used in UDF but
can be used in stored procedure.
No transactions allowed in functions in
UDF but in stored procedure they are
allowed.

TRANSACTIONS
Basically they block of statements but
which make sure that whether we want
to execute all of the queries or non of
queries so there is a chance that either
we can commit the queries else we can
rollback them also. transaction gives us
the behaviour which is like automic
consistent isolated and durable. so
transactions are very important if we
have some dependent queries which we
are writing in the stored procedure
DIFF INTERFACE AND
ABSTRACT CLASS
Interface is totally incomplete and
abstract also whereas in abstract class
we can write incomplite as well as
complete methods also in Interface we
cannot write fields in interface we cannot
write constructors in interface we cannot
write explicit access specifiers to the
interface members
whereas in abstract class we can write
fields we can write constructors also we
can write access specifiers to the
members so as per my understanding
whenever there is any requirement like we
want the different implementation different
method body for all the classes i will go
with interfaces whereas if i want some
common implementations then i will go
with abstract class

MULTIPLE INHERITANCE
Multiple inheritance means base class is
inheriting more than one classes but c
sharp do not support multiple inheritance
because of diamond problem
If we have to achieve multiple inheritance
we can create multiple interface. for
multiple inheritance we can create two
different interfaces and in one class we can
inherit both the interfaces

PROINTERFACE
We have various places where we have
used interfaces mainly we have
implemented repository pattern in our
project where we have use interfaces to
create the signature where we have a
methods to retrieve the entity
information to insert the entity to
update the entity or to delete the entity
apart from it we have implemented
interface to perform given task and given
functionality

PROENCAPSULATION
Encapsulation is a feature used to hide
data outside of that class and we have a
lots of models and classes we have
created in our project like we have
various classes like a farmer class
customer class in this class is there are
some information which I don't want
expose to outside class in that case we
have used in encapsulation
GLOBAL.ASAX
Global.asax file is application configuration
file global.asax file basically inherits HTTP
application class and this global.asax file
contains all the application level events like
application_start application_end this type
of events application level events are there
in global.asax file

BUNDLE.CONFIG
Bundle config basically when we do the
bundling and basically bundling is a
concept where we can merge multiple
JavaScript files or multiple CSS files to
improve the performance it reduces the
number of calls to the server and which
eventually improve the performance so in
bundle config file we actually creates the
bundle and we specifies the file names that
which files are there and which bundle we
want to create so bundle config file has all
the bundle name information and along
with that it has the file names also

HTML HELPERS
HTML Helpers are used in View to render
HTML content. Using html helpers we can
create the UI controls for example we have a
methods like editor for display for or display or
editor for model drop down list or checkbox so
we have lots of extension methods with the
html helper class and we can create our own
we can add methods also we can add our
own custom extension method also to this
html helper class
IOC
Inversion of Control (IoC) means that
objects do not create other objects on which
they rely to do their work.
DYAMIC POLYMORPHISM
dynamic polymorphism we have method
overriding method overriding means in
derived class we can override any method
from the base class and which gives the
benefit that whenever a base class
reference variable points to a derived
class object then in that case it will call
back overridden method
PARALLELISM
for parallelism we can basically use
multithreading or multitasking
programming where we can perform
multiple tasks at the same time
ASYNC AND AWAIT
Async and await keywords are basically
used to create a task so basically async and
await keywords are useful for a
synchronous call which actually improve
the performance so if I want to perform if I
want to call multiple methods at the same
time or if I want to call a method
asynchronously without dependency then I
can use async and await keyword
Main {print 1 ();print2();}
Public async void Print1()
{await Task.Run() = >
For(int i= 1; i<=5; i++)
{Console.WriteLine(i);}
Public async void Print2()
For(int I= 1; i<=5; i++)
{Console.WriteLine(i);}

JESON WEB TOKEN (JWT)


JWT (JSON web token) has become more
and more popular in web development. It is an
open standard which allows transmitting data
between parties as a JSON object in a secure
and compact way
RACE AROUND CONDITION
A race condition occurs when two or more threads
are able to access shared data and they try to
change it at the same time.

VIRTUAL KEYWORD
virtual keyboard we use if we want to override that
method in the derived class virtual keyboard
basically indicates that we can override that
method in the derived class .virtual method we can
write in any class as well as virtual method we can
write the implementation also

BASE KEYWORD
base keyword is basically it points to the current
instance of the base class so if we have the
inheritance and if we want to access any members
of base class in derived class then we can use
base keyword to access the members from base
class so using base keyword we can access the
properties fields constructor method also

DIFF REST AND RESTFUL


Basically it’s a architectural pattern and
whatever things which are following this
rest architecture pattern we can call them
as a restful there is no much difference
between rest and restful. rest is
architecture and whatever things are
following the rest architecture we can call
them at the restful for example web api is a
restful service because web api follow the
rest architecture pattern

PRO AUTHENETICATION AND


AUTHORIZATION
we have a forms based authentication and
for authorization we have used role based
authorization. so also in web api we have
used token based authentication and for
implementing this token based
authentication we have used jwt token. also
as i said that we have a role based
authorization for that purpose we have
multiple roles and for each and every role
there is a different types of functionality
and different types of access is there

CUSTOM FILTERS
we can implement the filter interfaces
we can inherit the filter classes and so
one way we can create the custom filter
that we can implement the interface
methods or we can override this action
filter methods in our custom filter class
and we can apply this custom filter
class either on the controller level or
action method level or maybe in our
filter config file so that it will be applied
globally in our project we have used
custom filter also so for exception
handel we have created our custom
exception filter
OVERIDING AND
OVERLADING
we can override a method in derived
class which we have already
declared in the base class whereas
overloading is a concept where we can
have same method name with different
signature we can overload a method
based on number of parameters, order
of parameters, types of parameters or
kinds of parameters overriding is a
runtime polymorphism whereas
overloading is a compile time
polymorphism
SKIP AND SKIP WHILE
Both methods we used to skip the
elements from the collection skip
method expects the count how much
element you want to skip from the
collection whereas skip while method
expects the condition on what basis you
want to skip the elament so that is the
difference between skip and skip while
in skip we are giving the count and in
skip while we are giving the condition
CTE
Common table expression cte we
used to store the result set for
temporary purpose the scope of cte is in
the next immediate statement and we
can use this cte in join or using the cte
we can select or update the records

IENUM AND IQUE


Ienumerable we use for the any
memory collections whereas iquarriable
we use for the remote collections.
ienumerable supports deferred
execution iquariable supports
immediate execution so for
performance wise ienumerable is
always better. both are the interfaces
and linq provides enumerable and
quariable APIs .
COMPOSITE KEY
Composite key is a key which is the
combination of more than one field or column
of a given table
NON ACTION METHOD
Non-Action is another built-in attribute which
indicates that a public method of a Controller
is not an action method. It is used when we
don't want that method to be treated as an
action method.
CACHING
Caching is a technique of storing frequently
used data/information in memory, so that,
when the same data/information is needed
next time, it could be directly retrieved from
the memory instead of being generated by the
application

FILTER.CONFIG
This is used to create and register global MVC
filter, error filter,action filter etc.By default it
contains HandleErrorAttribute filter.
for eg.
 Authentication filters (Executed First)
 Authorization filters
 Action filters
 Result filters
 Exception filters (Executed Last)
ROUTE.CONFIG
This is used to register various route patterns
for our Asp.Net MVC application. Routing
plays an important role in an ASP.NET MVC
Application in execution flow, it maps request
URL to a specific controller action using a
Routing Table. The RouteConfig. cs file is
used to set routing for the application.

PRIMARY KEY AND COMPOSITE


KEY
the primary key will consist of one column,
where the composite key will consist of two or
more columns

PRIMARY KEY FOREIGN KEY


A primary key is used to assure the value in
the particular column is unique. The foreign
key provides the link between the two tables.
DEPENDENCY INJECTION
DESIGN PATTERN
Dependency Injection (DI) is a design pattern
used to implement IoC. It allows the creation
of dependent objects outside of a class and
provides those objects to a class through
different ways. Using DI, we move the
creation and binding of the dependent objects
outside of the class that depends on them.

LAMBDA EXPRESSION
Lambda expressions are anonymous
functions that contain expressions or
sequence of operators. All lambda
expressions use the lambda operator.
1. public static class demo
2. {
3. public static void Main()
4. {
5. List<int> list = new List<int>() { 1, 2, 3, 4, 5,
6 };
6. List<int> evenNumbers = list.FindAll(x => (x % 2)
== 0);
7.
8. foreach (var num in evenNumbers)
9. {
10. Console.Write("{0} ", num);
11. }
12. Console.WriteLine();
13. Console.ReadLine();
14.
15. }

CUSTOM VALIDATION

You might also like