Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 200
  1. In this article, I will show you two simple tricks that help me understand the deployment status of my .NET APIs

  2. In case of unmanageable error, should you return null or throw exceptions?

  3. APIs often call other APIs to perform operations.

  4. Miniprofiler is a nice tool to profile your code in a smart way.

  5. Propagating HTTP Headers can be useful, especially when dealing with Correlation IDs.

  6. Good unit tests have some properties in common: they are Fast, Independent, Repeatable, Self-validating, and Thorough.

  7. LINQPad is one of the tools I use daily.

  8. SelectMany is one of the LINQ methods I’ve used the least.

  9. A suitable constructor for type ‘X’ could not be located.

  10. Duplication is not only about lines of code, but also about data usage and meaning.

  11. Logs are important.

  12. Initializing HttpClient instances can expose you to Socket Exhaustion problems.

  13. C# recently introduced Records, a new way of defining types.

  14. Should you write your tests with the same care you write the production code?

  15. In unit tests, sometimes you need to perform deep checks on the object passed to the mocked service.

  16. How to get all the keys of an ExpandoObject?

  17. After 100 articles, I’ve found some neat ways to automate my blogging workflow.

  18. Having too many ‘using’s, or imports, is a good indicator that your class does too many things.

  19. If your application is exposed on the Web, I guess that you get some values from the HTTP Requests, don’t you?

  20. It would be great if we could break the debugging flow if a condition is (not) met.

  21. With Entity Framework you can perform operations on relational databases without writing a single line of SQL.

  22. Is it true that we should always avoid comments in our code?

  23. We all need to parse strings as integers.

  24. What can you do if you need to temporarily change the CurrentCulture in C#?

  25. Mapping every SQL result to a data type can be a pain.

  26. The most important trait of Tests?

  27. Keeping an eye on maintainability is mandatory for every project which should live long.

  28. Instead of using if-else or switch blocks to handle exceptions, you can do it gracefully using the ‘when’ keyword.

  29. Once we have a Postgres instance running, we can perform operations on it.

  30. Mental mappings are a good way to write shorter code that you, and only you, can understand.

  31. PostgreSQL is a famous relational database.

  32. With Log4J’s vulnerability, we’ve all been reminded that systems are vulnerable, and OSS are not immune too.

  33. Yield is a keyword that allows you to return an item at the time instead of creating a full list and returning it as a whole.

  34. Is your application slow?

  35. Following a coherent standard, even for parameters order, helps developers when writing and, even more, reading code.

  36. JSONL is JSON’s less famous sibling: it allows you to store JSON objects separating them with new line.

  37. Using the right data structure is crucial to building robust and efficient applications.

  38. Did you know that in .NET you can resolve specific dependencies using Factories?

  39. When a function has too many parameters, it’s clear that something is wrong.

  40. Moq and NSubstitute are two of the most used library to mock dependencies on your Unit Tests.

  41. Sometimes you need to ping some endpoints.

  42. Serilog is a famous logger for .NET projects.

  43. Smaller functions help us write better code, but have also a nice side effect: they help us to understand where an exception was thrown.

  44. Mocking IHttpClientFactory is hard, but luckily we can use some advanced features of Moq to write better tests.

  45. Sometimes we need to use objects with the same name but from different namespaces.

  46. Every time you ask Visual Studio to generate properties for you, it creates them with a simple, default format.

  47. Smaller functions help us write better code, but have also a nice side effect: they help us to understand where an exception was thrown.

  48. You should not add the caching logic in the same component used for retrieving data from external sources: you’d better use the Decorator Pattern.

  49. Creating simple DateTimes creates issues when handling timezones.

  50. In any application, writing code that is clean and performant is crucial.