I have two methods:
BuildThing(Thing a);
BuildThings(IEnumerable<Thing> things);
Is this good from a clean code point of view?
Or is maybe it would be better to just use BuildThings and pass IEnumerable with only one Thing? Or use params?
Thanks.
my personal preference is as follows
interface:
implementation:
the reason I prefer to use this pattern is because it makes sure that you stay DRY whilst giving you the flexibility of having multiple overloads, unlike the
paramsway where you’d have to convert any non-array enumerable to an array.