C# Tip: 2 ways to generate realistic data using Bogus
Bogus is a library that generates realistic values for your data. When populating fake user names, instead of Foo and Bar, you can have John and Sarah. Let’s see two ways to define and reuse a Faker definition. Continue readingC# Tip: IEnumerable vs ICollection, and why it matters
When working with Lists in C#, you are working on a data structure that implements both ICollection and IEnumerable. What’s the difference between ICollection and IEnumerable? Why should you care about them, especially when exposing functionalities to external clients? Continue readingC# Tip: 2 ways to use custom equality rules in a HashSet
With HashSet, you can get a list of different items in a performant way. What if you need a custom way to define when two objects are equal? Continue readingC# Tip: Mark a class as Sealed to prevent subclasses creation
The sealed keyword is often ignored, yet it can be important to define a proper class design. Continue readingC# Tip: Path.Combine and Path.Join are similar but way different.
When composing the path to a folder or file location, thePath
class can come in handy. Path.Join
and Path.Combine
may look similar, but their behavior differ in an unexpected way.
Continue reading