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 core framework?
How we can add the css in mvc?
How OS come to know whether to load the .net framework when we run an .exe created using .Net framework?
What symbol would you use to denote, the start of a code block in razor views?
Which are the important namespaces used in ASP.Net MVC?
Why is entity framework used?
what is conceptual model?
mention what is csdl, ssdl and msl sections in an edmx file?
Explain the advantages and disadvantages of ASP.Net MVC over ASP.NET?
What is stateless model?
How do I install .net framework?
What are the benefits of .net framework?
What are html helpers in asp.net mvc?
What is entity framework? : Entity framework
Explain the role of assembly in the .net framework.