Depedency injection : firstly we have to clear the problem of inheritance. Class A { void add() { c= a + b; } } if we want to use add() in class B Class B : A { Void sub() { c= a - b; } } and want to use add() and Sub() in class C Class C : A, B { Void mul() { c= a * b; } } if we have to change in add method in class a , that will reflect in all of three class. so remove this depedency , we use depedency injection to remove this tightly coupling. for this , interface Iinterface { void add (); void sub(); void Mul(); } class A : Iinterface { void add() { c= a+ b; } } Class B : Iinterface { Void Add() { c= A%b; } void sub() { c= a - b; } } Class C : Iinterface { void Mul() { c = a* b; } } This means, we can change the defination accordingly. and call the respective function accordingly. /**********************************************************************************************************/ 2. Ref and Out parameter : Ref : 1. The ref keyword is used to pass an argument as a reference. 2. ref keyword must be initialized in the calling method before it is passed to the called method. Example : class Program { static void Main(string[] args) { int i = 0; //must be initialized refMethod(ref i); Console.WriteLine(i); } static void refMethod(ref int value) //called method { value = 100; } } Out : 1. To pass a variable as out parameter no need to initialize it before we pass it as out parameter to method. 2. A return statement can be used for returning only one value from a function. However, using output parameters, you can return two values from a function. class Program { static void Main(string[] args) { int i, j; // No need to initialize variable OutMethod(out i, out j); Console.WriteLine(i); Console.WriteLine(j); } public static void OutMethod(out int value1, out int value2) { value1 = 50; value2 = 100; } } /**********************************************************************************************************/ 3. Document.ready and windows.load function Document.ready : it will be called when HTML DOM gets fully loaded.and also its need less time to load bcz its only called just after our HTML DOM are fully loaded. Windows.load : it will be called when our HTML DOM and content (images) of DOM are fully loaded. and also its need more time than ready function to load bcz its only called after html DOM and Content (images) are fully loaded. 4. Foreach and For loop : For loop : The for loop's variable always be integer only. The For Loop executes the statement or block of statements repeatedly until specified expression evaluates to false. Foreach loop : The foreach statement repeats a group of embedded statements for each element in an array or an object collection. You do not need to specify the loop bounds minimum or maximum. 5. String and Stringbulder : String : String is immutable, Immutable means if you create string object then you cannot modify it and It always create new object of string type in memory. Stringbulder : StringBuilder is mutable, means if create string builder object then you can perform any operation like insert, replace or append without creating new instance for every time.it will update string at one place in memory doesnt create new space in memory. 6. .aspx and cshtml .aspx (Web Form Aspx Engine): 1. ASPX View Engine is the default view engine for the ASP.NET MVC that is included with ASP.NET MVC from the beginning. 2. ASPX View Engine supports System.Web.Mvc.WebFormViewEngine. 3. In ASPX View Engine we use masterPages. 4. In ASPX View Engine we use WebUserControls. 5. ASPX View Engine has a similar extension as in a simple web application like .aspx for the views, .acsx for UserControls and .master for Master Pages. 6. Aspx Engine is faster compared to Razor Engine. 7. ‘<%:’ delimiters use as starting point and ‘ %>’ use as ending point. You can write the code between them in ASPX Engine. 8. ASPX Engine does not prevent Cross-Site Scripting Attacks, in other words any script saved in the database will be fired while rendering the page. .cshtml (Razor View Engine) : 1. Razor View Engine is an advanced view engine and introduced with MVC3. This is not a language but it is a markup syntax. 2. Razor View Engine supports System.Web.Razor. 3. In Razor View Engine we use Layouts. 4. In Razor View Engine we use PartialPage. 5. Razor View Engine has .cshtml (with C#) and .vbhtml (with VB) extension for views, Layout and Partial views. 6. Razor Engine is a little slow compared to Aspx Engine. 7. ‘@’ symbol uses in Razor Engine to write the code. @Html.ActionLink("Login", "LoginView") 8. Razor Engine prevents Cross-Site Scripting Attacks, in other words it encodes the script or HTML tags like <,> before rendering to view. 7. Innerjoin and Intersect12 : Intersect : 1. Intersect does all columns. 2. Use an intersect operator to returns rows that are in common between two tables; it returns unique rows from both the left and right query. 3. This query is useful when you want to find results that are in common between two queries. Inner Join: 1. Inner join only the specified columns. 2. An inner join attempts to match up the two tables based on the criteria you specify in the query, and only returns the rows that match. 3. If a row from the first table in the join matches two rows in the second table, then two rows will be returned in the results. 8. Editor and EditorFor : Editor : 1. HTML editor and a simple text editor.Editor() method requires a string expression parameter to specify the property name. It creats a html element based on the datatype of the specified property. EditorFor() : 1. EditorFor() method is a strongly typed method. It requires the lambda expression to specify a property of the model object. 9. Function and Procedure : Function : 1. Function must return a value 2. Functions can have only input parameters for it. 3. Functions can be called from Procedure. Stored Procedure : 1. It is optional.Procedure can return zero or n values. 2. Procedures can have input/output parameters. 3. Procedures cannot be called from Function. 10. Types of functions : 1. System Defined Function : a.Scalar Function : Scalar functions operates on a single value and returns a single value. Example : Scalar Function Description abs(-10.67) This returns absolute number of the given number means 10.67. rand(10) This will generate random number of 10 characters. round(17.56719,3) This will round off the given number to 3 places of decimal means 17.567 upper('dotnet') This will returns upper case of given string means 'DOTNET' lower('DOTNET') This will returns lower case of given string means 'dotnet' ltrim(' dotnet') This will remove the spaces from left hand side of 'dotnet' string. convert(int, 15.56) This will convert the given float value to integer means 15. b.Aggregate Function : Aggregate functions operates on a collection of values and returns a single value. Example : max() ,min() ,avg() ,count() 2. User Defined Function : a.Scalar Function : User defined scalar function also returns single value as a result of actions perform by function. We return any datatype value from function. b.Inline Table-Valued Function : User defined inline table-valued function returns a table variable as a result of actions perform by function. The value of table variable should be derived from a single SELECT statement. c.Multi-Statement Table-Valued Function : User defined multi-statement table-valued function returns a table variable as a result of actions perform by function. In this a table variable must be explicitly declared and defined whose value can be derived from a multiple sql statements. 11. Interface : An interface in C# contains only the declaration of the methods, properties, and events, but not the implementation Example : interface ILog { void Log(string msgToLog); } class ConsoleLog: ILog { public void Log(string msgToPrint) { Console.WriteLine(msgToPrint); } } class FileLog :ILog { public void Log(string msgToPrint) { File.AppendText(@"C:\Log.txt").Write(msgToPrint); } } ILog log = new ConsoleLog(); //Or ILog log = new FileLog(); ---- Implement Interface Explicitly class ConsoleLog: ILog { public void ILog.Log(string msgToPrint) // explicit implementation { Console.WriteLine(msgToPrint); } }