Can we have more than 1 partial classes in the same file?
Answers were Sorted based on User's Feedback
Answer / ssv_sathish
YES, basically, partial classes are meant for sharing or
working on different files. so you can have 2 partial
classes in the same file or different class declared as
partial in the same file, provided PUBLIC is the access
modifier.
| Is This Answer Correct ? | 35 Yes | 4 No |
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 |
Answer / m.karunakar
yes.more than one programmer working in the same module in
the project.example one progrmmer writing one method in main
system and ononther programmer can also add onother method
are functionlity that class by using partial class.
| Is This Answer Correct ? | 3 Yes | 0 No |
How does servicing work for the .net framework 3.0?
What is Separation of Concerns in ASP.NET ASP.Net MVC?
What is edm (entity data model)? : Entity framework
Is dapper better than entity framework?
What is the meaning of unobtrusive javascript? Explain us by any practical example.
how to create session in .net
How can I return string result from action in asp.net mvc?
What is the difference between Finalize and Dispose (Garbage collection)
Is it possibe to run 2 aplication on single m/c, one App is on .Net Framework 1.0 and another one is on .Net Fremework 2.0?
Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?
What is a serverside technology? what is a clientside technology? what is a clientserver technology? what is a internet based application? what is a intranet based application? what is a windows application? what is a console application? Difference between console application and windows application?
Define the core components of an ASP.NET MVC application?