SELECT name
FROM sys.procedures
WHERE Object_definition(object_id) LIKE ‘%searchstring%’
What is IOC Container
IOC Container is a mechanism to achieve dependency injection to make our classes loosely coupled.
We can achieve inversion of control using 2 ways-
1. Dependency injection pattern
2. Service Locator pattern
There are many IOC Container available in .Net,some of mostly used are as given below…
- Castle Windsor
- Ninject
- Autofac
- Unity
What is difference between = and == and === in jquery ?
= This is an assignment operator.
== This is an comparison operator. e.g.
"2"==2;// output: true
=== This operator compares value of both side with type checking.
e.g.
"2"==2;//output:false
Can I use 2 version of same jquery library ?
Yes we can.
We will use $.noconflict
src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"type="text/javascript">src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"type="text/javascript">var$oldjQuery=$.noConflict(true);
Whais difference in char, varchar and nvarchar ?
Char:
- It is used for fixed length.
- Char is not memory efficient I’d data in column varying in size.
Varchar:
- Takes 1 byte per char.
- VARCHAR is used for Variable Length Size Variable.
- It is memory efficient.
- It support non-unicode data.
Nvarchar:
- Takes 2 byte per char.
- NVARCHAR is used for Variable Length Size Variable.
- A nvarchar column can store any Unicode data
What is Rest
Rest(Representational State Transfer) is a architectural pattern to develop a api in restful manner
1- Follow rest suggested uri pattern e.g http://ABC.com/api/manage-employee http://ABC.com/api/manage-employee/1
2- Follow respective HttpVerb for each action.
e.g.
[HttpGet] //for retrieve data http://ABC.com/api/manage-employee
[HttpPut] // for update http://ABC.com/api/manage-employee/1
3. It works over HTTP Protocol.
Can we have same method name in mvc ?
Yes.
We have to decorate attribute [ActionName] on action to do so.
Can we create a private class in C #
Yes.
we can but a private/protected/protected internal class should be a nested class.
Will code in a Finally statement fire if I return a value in a Try block?
Yes.Finally will always be called whatever happens in try catch block.
Use of out keyword in c#
The main use of out would be where your method needs to return more then one parameter.
See below example of TryParse Method
using System;
public class Example
{
public static void Main()
{
String[] values = { null, “160519”, “9432.0”, “16,667”,” -322 “, “+4302”, “(100);”, “01FA” };
foreach (var value in values)
{
int number;
bool success = Int32.TryParse(value, out number);
if (success)
{
Console.WriteLine(“Converted ‘{0}’ to {1}.”, value, number);
}
else
{
Console.WriteLine(“Attempted conversion of ‘{0}’ failed.”,
value ?? “<null>”);
}
}
}
}