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

How route table has been created in asp.net mvc?

755


What is meant by bootstrap in mvc5?

868


Can you explain the page life cycle of mvc?

777


What is difference between Viewbag and Viewdata in ASP.NET MVC?

813


What is .net architecture?

755


Is it possible to cancel filter execution?

758


What is ViewData and TempData in ASP.Net MVC?

795


What is poco proxy? : Entity framework

775


Is razor a server side?

726


Which are the important namespaces used in ASP.Net MVC?

822


Do you know about the new features in ASP.Net MVC 4 ?

806


What is edm (entity data model)? : Entity framework

757


Explain Sections is ASP.Net MVC?

811


What is a model in android?

690


What is the difference between model view and controller?

686