1. Which of the following statements is correct for ASP.NET MVC Routing in .Net Framework 4.0?
Answers: • It is used to match the incoming requests and to map them to a controller action.
2. Consider the following code snippet:
namespace ExtensionMethods
{
public static class NumericExtensionMethods
{
public static bool IsNumeric(this string s)
{
float output;
return float.TryParse(s, out output);
}
}
}
After adding the namespace, how will you call the ExtensionMethod on the string if your string variable is defined as:
string test="4";
namespace ExtensionMethods
{
public static class NumericExtensionMethods
{
public static bool IsNumeric(this string s)
{
float output;
return float.TryParse(s, out output);
}
}
}
After adding the namespace, how will you call the ExtensionMethod on the string if your string variable is defined as:
string test="4";
Answers: •
test.IsNumeric();
3. What is the purpose of the System.Windows.Data namespace in .Net framework
4.0?
Answers: •
It contains classes used for binding properties to data sources, data source
provider classes, and data-specific implementations of collections and views.
4. Suppose you want to eliminate duplicate elements from the array
int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23}
and sort the elements in descending order using LINQ in .Net framework 4.0. Which of the following statements can you use?
int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23}
and sort the elements in descending order using LINQ in .Net framework 4.0. Which of the following statements can you use?
Answers: •
var result = (from s in source orderby s descending select s).Distinct();
5. Which of the following classes of System.Windows.Media namespace provides
rendering support in WPF which includes hit testing, coordinate transformation,
and bounding box calculations in .Net framework 4.0?
Answers: •
Visual
6. How will you count the odd numbers from the array shown below using LINQ in .Net framework 4.0?
int[]numbers={5,4,1,3,9,8,6,7,2,0};