Can we have more than 1 partial classes in the same file?
Answer Posted / mahesh kotekar
It is possible to have partial class in same class file.
Partial Class Concept was used in dotnet to provide
practically dividing the class into two or multiple physical
files. In order to keep the complexity of class
simple.During compilation the partial classes join together
to form a single class and works as normal class
partial class First
{
public static void DoSomething1()
{
Console.WriteLine("Executing from First Part of
Class First");
}
}
partial class First
{
public static void DoSomething2()
{
Console.WriteLine("executing from second part of
class First");
}
}
Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
What is .net architecture?
What is difference between html.beginform and ajax.beginform?
What are the possible razor view extensions?
Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?
Explain what is routing?
Is .net core faster than .net framework?
What “beforFilter()”,“beforeRender” and “afterFilter” functions do in Controller?
Describe the .net framework architecture.
Explain bundle.config in mvc4?
What is the use .Glimpse in ASP.Net MVC
explain how you can load related entities in ef (entity framework)?
what is .edmx file and what it contains?
How route table is created in ASP.NET MVC?
what is entity graph in entity framework?
What is presentation framework?