Closed TyMick closed 3 years ago
Thank you! I will try to review these changes soon!
There, that should be much better! Thanks especially for catching my creating all those extra immutable objects. Since the underlying IReadOnlyList
is storing tuples, a value type, the operation of copying such a read-only list has O(n) complexity, right? since it's having to copy every individual value? Which means, by extension, that when I created a new DbParameters
in every single loop inside my FromMany
method, that gave it O(n²) complexity?
By contrast, the new version of FromMany
that adds each new value to a mutable List
and waits till the end to create the returned DbParameters
should have O(n) complexity, right?
Right!
Hello! 😊 This PR adds several new methods to
DbParameters
(and modifies two existing ones):Collections (resolves #7):
DTOs (resolves #8):
I added an optional
string? suffix
parameter to each DTO method to make the "collections of DTOs" methods (#9) more succinct.Collections of DTOs (resolves #9):
I also added tests for each of these methods along the way.
Is adding the optional
string? suffix
parameter to the original DTO methods a good solution? Would it be better to restore the original versions and add additionalsuffix
overloads? Or would it be best to throw out thesuffix
params altogether and just do the extra work in the "collections of DTOs" methods?