New answers tagged

1 vote

Factory method doesn't meet the DRY principle

You might implement a generic version of your method because your cases only differ in a generic argument of ActivatorUtilities.CreateInstance ...
  • 4,085
1 vote
Accepted

Factory method doesn't meet the DRY principle

I don't know C#, so my answer is pretty generic. The only difference between the two cases is within the closure / lambda (or whatever C# calls it), so you can just assign the respective closure ...
2 votes
Accepted

Parsing information from Excel files

ExcelParser Import Please do not use the comments to echo what you are about to do Use the comments to capture the why or why ...
  • 6,204
5 votes
Accepted

Transliterate between Cyrillic and Latin scripts

Dynamic vs Static lookup table You are recreating each and every time the same lookup table whenever someone calls the Create method This is unnecessary since you ...
  • 6,204
1 vote
Accepted

Finding exceptions and optimisations in weather forecast service

The GetForecastAsync method Since you always call it with DateTime.Now from FetchData.razor ...
  • 6,204

Top 50 recent answers are included