summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Backes <backes.andrew@gmail.com>2015-10-15 23:26:57 -0500
committerAndrew Backes <backes.andrew@gmail.com>2015-10-15 23:26:57 -0500
commitd65e738fc339c7b1481dc88cb1c39d1ec8777b6d (patch)
tree2668b5d2be276c5797b5462357e17ca62d272674
parent46c37fd745c297cb97596a42400c1b4af2e3bba7 (diff)
[csharp/eng] Partial Classes example
-rw-r--r--csharp.html.markdown29
1 files changed, 29 insertions, 0 deletions
diff --git a/csharp.html.markdown b/csharp.html.markdown
index 7aca2c6f..d62dadec 100644
--- a/csharp.html.markdown
+++ b/csharp.html.markdown
@@ -911,6 +911,35 @@ on a new line! ""Wow!"", the masses cried";
public DbSet<Bicycle> Bikes { get; set; }
}
+
+ // Classes can be split across multiple .cs files
+ // A1.cs
+ public partial class A
+ {
+ public static void A1()
+ {
+ Console.WriteLine("Method A1 in class A");
+ }
+ }
+
+ // A2.cs
+ public partial class A
+ {
+ public static void A2()
+ {
+ Console.WriteLine("Method A2 in class A");
+ }
+ }
+
+ // Program using the partial class "A"
+ public class Program
+ {
+ static void Main()
+ {
+ A.A1();
+ A.A2();
+ }
+ }
} // End Namespace
```