C#
Try to follow standard C# naming conventions when applicable
https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines
Except for constants... For constants prefer UPPER_SNAKE_CASE.
Examples
// Interfaces
public IThingService
{
Task<Thing> GetAThingAsync(int thingId);
void DoTheThing(int thingDoingAmount);
Task DoTheThingAsync(int thingDoingAmount, CancellationToken? cancellationToken = null);
}
// Classes
public class ThingService
{
private const string THIS_IS_A_CONSTANT = "I am a constant!";
private readonly IThingRepository _thingRepository;
public int ThingsDone { get; private set; }
private bool _isDoingOtherThings;
public ThingService(IThingRepository thingRepository)
{
_thingService = thingService;
}
public void DoAThing()
{
if (!_isDoingAnotherThing)
{
ThingsDone++;
}
}
public async TasK DoAnotherThing()
{
_isDoingOtherThings = true;
await ExecuteVeryImportantBusinessAsync();
_isDoingOtherThings = false;
}
private async Task ExecuteVeryImportantBusinessAsync()
{
await Task.Delay(1_000);
}
}