what are partial classes?
Answer Posted / sridhar.venkataramanan
File 1.
partial class Employee
{
string employeename;
public void getEmployeeName(string empname)
{
employeename = empname;
}
public static void Main()
{
Employee objEmployee = new Employee();
objEmployee.getEmployeeName("Krish");
objEmployee.showEmployeeName();
Console.ReadLine();
}
}
File 2
partial class Employee
{
public void showEmployeeName()
{
Console.WriteLine("Name --->" + employeename);
}
}
Even though the method showEmployeeName is not a available
in file 1 since its partial class the complier would
combine the fragments of the file that corresponds to same
class.
Is This Answer Correct ? | 28 Yes | 6 No |
Post New Answer View All Answers
What is partialview in asp.net mvc?
Why we need a separate mobile project template, while we can render our web application in mobile ?
What is .net framwork?
Is .net framework 4.8 the last version?
How to use Jquery Plugins in ASP.Net MVC validation?
What is asp net framework?
What are differences between entity framework and l2s? : Entity framework
What are the levels at which filters can be applied in an asp.net mvc application?
What is the use of viewmodel in mvc?
What is the difference between model view and controller?
Where is tempdata stored?
Mention the core components of .net framework?
What is mapping in entity framework? : Entity framework
What are the components required to create a route in mvc?
What are action filters?