Name, Email Users Name, Email (COUNT ( ) ) : Select From Group BY Having
Name, Email Users Name, Email (COUNT ( ) ) : Select From Group BY Having
Implementation of
dispose method. 2. Generation of garbage collector.
3. Extension methods.
6. View state in asp.net - first and last method in asp.net life cycle where
can change get/change viewstate.
9. How can you force a singleton class to create only one object. Code for
it.
10. MVC viewbag and viewdata 11. Why C# doesnt support multiple
inheritance. (ans: because of diamond problem)
14. Difference between abstract class and interface and real world situation
where you will use interface and abastracat classes. SQL 1. Nested
Transaction. If inner transaction is commited and outer transaction fails .
What will be the overall state of that transaction. 2. Can SQL function have
transactions. 3. Transaction defined in both sql server and asp.net. What if
code does the commit and sql procedure commit fails. 4. Difference
between clustered and non clustered index. 5. SQL query to find duplicate
rows.
With CTE_Duplicates as
(select empid,name , row_number() over(partition by empid,name order by empid,name
) rownumber
from EmpDup )
delete from CTE_Duplicates where rownumber!=1
3. solid principle
4. singleton
CORS (Cross-Origin Resource Sharing)
Interview:
1. Join in linq:
var query = from p in db.Employees
join r in db.Students
on p.EmpId equals r.PersonId into temp
from t in temp.DefaultIfEmpty()
select new
{
Designation = p.EmpDesignation,
EmployeeName = p.EmpName,
FirstName = t.FirstName,
LastName = t.LastName,
Age = t.Age
};
2. Join in lambda exp:
var LambdaQuery = databaseEntities.Employees.Join(databaseEntities.Departments, e => e.ID,
d => d.EmpID, (e, d) => new
{ e.ID, e.Name, d.DepartmentName
});
3. A lambda expression is an anonymous function that you can use to create delegates or expression tree
types. By using lambda expressions, you can write local functions that can be passed as arguments or
returned as the value offunction calls.
4. Static vs Sealed:-
It is a sealed class.
We cannot create instance of static class that's the reason we cannot have instance members in
static class, as static means shared so one copy of the class is shared to all.
Static class:
1) A static class can not be instantiated. Means you can't create instance of any static class.
2) A static class can have only static member (e.g static method, property, and variables).
3) A static class restrict the user to call default constructor of the class.
4) Static classes can only have static constructor to initialize static members.
5) Static classes are sealed so they can not be inherited.
Sealed Class:
1) When a class defined as sealed its not possible to inherit.
2) A Sealed class is last class of Inheritance feature.
3) Use the sealed modifier in a class declaration to prevent inheritance of the class.
4) It is not permitted to use the abstract modifier with a sealed class.
5) Structs are implicitly sealed; therefore, they cannot be inherited.
Magic Table:
1. Magic tables are nothing but inserted and deleted which are temporary objects
created by the server internally to hold recently inserted values in the case of insert
and to hold recently deleted values in the case of delete, to hold before updating
values or after updating values in the case of update.
2. These two tables, inserted and deleted, are called magic tables.
3. Magic tables are used to put all the deleted and updated rows. We can retrieve
the column values from the deleted rows using the keyword "deleted".