I use Resharper code cleanup before every commit to make sure we are not committing whitespace updates and everything is ordered in a defined fashion.
While working with some classes I would like Resharper sort to properties in a specific order which provides more visibility to the developers while developing or debugging.
As in the example below, I'd like Resharper to sort members so that Id is always the first property followed by Name and then Amount and so on and so forth...
Before Cleanup
public class A {
{
public Account Account { get; set; }
public string AccountId { get; set; }
public decimal Amount { get; set; }
public int OccurrenceNumber { get; set; }
public string Id { get; set; }
public string Name { get; set; }
public DateTime StartDateTime { get; set; }
public DateTime EndDateTime { get; set; }
}
}
Desired result After Cleanup
{
public string Id { get; set; }
public string Name { get; set; }
public decimal Amount { get; set; }
public Account Account { get; set; }
public string AccountId { get; set; }
public int OccurrenceNumber { get; set; }
public DateTime StartDateTime { get; set; }
public DateTime EndDateTime { get; set; }
}
I have been trying to customise the File layout but I do not know what I am doing there.