Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to get data access layer of singleton ?
Posted
Comments
Nelek 10-Oct-13 6:21am    
Have you tried to google?

Quote:
Please check this link

Singleton
 
Share this answer
 
A partial class allows a single class to be divided in to two separate physical files. During compile time these files get compiled in to single class. For instance you can see in the below figure we have the customer class divided in to two different files “math1.cs” and “math2.cs”.

During compilation these files gets compiled in to single class internally. So when you create an object of the customer class you will be able to see methods lying in both the physical files. For instance you can see “Add” method belongs to “math1.cs” and “Delete” method belongs to “math2.cs” , but when the math object is created we can see both “Add” and “Multiply” methods.

public class MyClass
{
Math obj=Math();
obj.
//You will get Add, Multiply methods after dot operation
}

public partial class Math
{
public int add(int x, int y)
{
return x+y;
}
}

public partial class Math
{
public void Multiply(int x, int y)
{
return x*y;
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900