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


Please Help Members By Posting Answers For Below Questions

What is .net architecture?

535


What is difference between html.beginform and ajax.beginform?

596


What are the possible razor view extensions?

561


Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?

617


Explain what is routing?

508






Is .net core faster than .net framework?

542


What “beforFilter()”,“beforeRender” and “afterFilter” functions do in Controller?

541


Describe the .net framework architecture.

568


Explain bundle.config in mvc4?

634


What is the use .Glimpse in ASP.Net MVC

565


explain how you can load related entities in ef (entity framework)?

531


what is .edmx file and what it contains?

592


How route table is created in ASP.NET MVC?

587


what is entity graph in entity framework?

613


What is presentation framework?

537