1. Diff between struct and class.
2. When we should use struct and when class?
3. A class has a list struct array, what will be the impact on performance.
Ans : degrade because member variable will go in heap
4. When static variable initialized?
1. What is index?
2. Why do we need index?
3. On which column we should apply index.
4. Diff bet store procedure and function.
5. Which function return more than one value?
To return multiple values from a function you need to return table
CREATE FUNCTION MyFunction
RETURN (SELECT Column1,Column2 FROM MyTable WHERE ColumnX="MyParam)
It is called table valued function.
6. Inner join, Left Outer Join, Right Outer Join, Full Join, Cross Join, Union and Union All
7. If table has wrong entry for a column named gender, write query to correct. Female has entered M and Male has entered F by mistake.
Ans : UPDATE tbl SET Gender = (CASE WHEN Gender = 'Male' THEN 'Female' ELSE 'Male' END)
8. What is data integrity?
1. What is DBContext?
Ans: It is a bridge between your domain or entity classes and the database.
2. We have two table Customer and Order, We want data for the order, customer wise.
3. What is benefit of MVC?
4. What is difference between MVVM and MVC?
5. Which approach will you use model first, code first, data base first.
And which approach will you use when.
6. What is data anotation?
7. Write an annotation so that a field only accept value in hexa decimal.
8. What are contents in edmx file?
1. How many contract are there in WCF?
2. If we have private property in a data contract than this property will expose or not.
3. If want to prevent a property from exposing to outside world in WCF.
Ans : Make it private and remove DataMember
4. If we have two method with same name in WCF. Than how will you handle it.
Ans : Overload with Name attribute of OperationContract.
1. Diff Between Web API and Web Service.
2. We have an enum which contains color name, How will you pass enum value in Web APi method.