standards-c-sharp icon indicating copy to clipboard operation
standards-c-sharp copied to clipboard

Agoda's standards and practices for C# code

Results 7 standards-c-sharp issues
Sort by recently updated
recently updated
newest added

List => SynchronizedCollection SynchronizedCollection : use lock statement in every access You should use one of the collections provided by the System.Collections.Concurrent namespace [When to Use a Thread-Safe Collection](http://msdn.microsoft.com/en-us/library/dd997373.aspx)

bug

## Goals We build libraries to share code. We OpenSource them to share with the community. We InnerSource them to share within our company. The more people using the shared...

This technique is mensioned in a few of the articles but never officially documented. Not sure if this is standards or style though. Maybe it belongs in a different section...

Similar to this https://agoda-com.github.io/standards-c-sharp/reflection/hard-coded-strings.html https://github.com/agoda-com/AgodaAnalyzers/issues/35 Loading assemblies in can lead to run time errors that compile time checkers cant detect.

I think we should include some recommendations from here https://docs.microsoft.com/en-us/aspnet/core/performance/performance-best-practices?view=aspnetcore-2.2

1. Change constructor name to the name of the class in MyController. 2. Remove unused variable in the MyViewModel class.

If you have to use `this`, it means you've named your private field wrong. `_privateField` instead of `this.privateField`.