O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Partial Types

Although at this point we’re focusing on members that live in types such as structs and classes, this is a good time to introduce the concept of partial definitions. To set the scene, we have to discuss the physical structure of a development project in terms of files and the types they define.

It’s typical and considered good style to define types in a file that has the same name as the type itself. For example, a class Person would be defined in a file called Person.cs. Although this is not required by the compiler or the runtime (in contrast to, say, Java, where folders and files play a role in type lookup), it has various advantages when browsing code.

During prototyping or experimentation, though, it’s often handy to put multiple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required