Naming Conventions For Partial Class Files

I use . separation – for example EmployeeController.SomeSpecialBehaviour.cs. I also link it into the project tree via “dependentUpon” or whatever it is in the csproj, so that it nests under the file (in solution explorer) neatly. You have to do that by hand (edit the csproj) or with an addin, though; for example: <Compile Include=”Subfolder/Program.cs” … Read more

Can I define properties in partial classes, then mark them with attributes in another partial class?

Here is the solution I have been using for such cases. It is useful when you have auto-generated classes that you want to decorate with attributes. Let’s say this is the auto-generated class: public partial class UserProfile { public int UserId { get; set; } public string UserName { get; set; } public string Firstname … Read more