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
Which filter executes first in an asp.net mvc application?
How do I install .net framework?
how can you tell ef to have a different table or column name than that defined for the class?
What is objectset? : Entity framework
What are Model Binders in ASP.Net MVC?
What is Dependency Injection in ASP.Net MVC
Is dapper faster than entity framework?
what is scalar property?
What is meant by viewdata?
How to change the action name in mvc?
Explain the difference between viewbag and viewdata in mvc?
What is the role of the jit compiler in .net framework?
Explain representational state transfer (rest) in detail?
what is entity sql?
What are the components of the .net framework.