|
What is the difference between variable and property(C# Interview questions with answers)?
When we talk about any class or object it has two things –
|
How can we loop through ENUM values( C# ENUM Interview questions with answers)?
We can use “GetValues()” method of the “ENUM” cl
|
3 important c# Partial class interview questions with answers
Can you explain one
practical scenario when we should use partial cla
|
C# interview questions with answers: - Find if number is even or odd ?
This is a damn simple
c# interview questions on even and odd numbers . But
|
C# OOP interview questions and answers: - I do not want to implement all the interface methods?
This is a simple c# OOP
interview question which was asked to one of our readers in an IT compan
|
C# and .NET Interview questions and answers: - What is Razor and when should we use it?
It’s a light weight view engine. Till MVC we
had only one view type i.e.ASPX, Razor was introduced in MVC 3.
Razor
is clean, lightweight and syntaxes are each as compared to ASPX. For example in
ASPX to display simple time we need to write.
<%=DateTime.Now%>
In
Razor it’s just one line of code.
@DateTime.Now
As
per Microsoft razor is more preferred because its light weight , can be unit
tested and has simple syn
|
C# and ASP.NET MVC (Model view controller) interview questions and answers: - How can we restrict MVC actions to be invoked only by GET or POST?
We can
decorate the MVC action by “HttpGet” or “HttpPost” attribute to restrict the
type of HTTP calls. For instance you can see in the below code snippet the
“DisplayCustomer” action can only be invoked by “HttpGet”. If we try to make
Http post on “DisplayCustomer” it will throw a error.
[HttpGet]
public ViewResult
DisplayCustomer(int id)
{
&
|
C# interview questions: - Top c# interview questions asked in c# and .NET interviews
The below text is taken from .NET interview question book and SQL Server interview question book . Below are top 50 c# interview question which are asked in c# and .NET interviews. 1.Can you explain architecture of your current project? 2.What role did you play in your project and company? 3.What’s your salary expectation? 4.Why do you want to leave your previous organization? 5.How much do you rate yourself between 1 to 10? 6.Can you speak about yourself? 7.How can we improve perf
|
C# interview question: - Partial methods in partial classes of C# and .NET?
Partial methods are important components of partial classes. Read and click on the following link in case you are new to partial classes.
Partial methods helps us to define a method definition in one of the physical files and we can implement that method in the other physical files as shown in the below figure.
In the below figure you can see we have defined “Validate” method in “Customer1.cs” and this validate method is implemented in “Customer2.cs”. Please note the partial keywords at
|
C# interview questions: - Elaborate partial classes in C# and .NET?
A partial class allows a single class to be divided in to two separate physical files. During compile time these files get compiled in to single class. For instance you can see in the below figure we have the customer class divided in to two different files “customer1.cs” and “customer2.cs”.
During compilation these files gets compiled in to single class internally. So when you create an object of the customer class you will be able to see methods lying in both the physical files. For insta
|