Closed Arash-Sabet closed 9 months ago
Signature of e.g. PostDocumentsAsync:
public virtual async Task<PostDocumentsResponse<T>> PostDocumentsAsync<T>(
string collectionName,
IList<T> documents,
PostDocumentsQuery query = null,
ApiClientSerializationOptions serializationOptions = null,
DocumentHeaderProperties headers = null,
CancellationToken token = default)
I assume you are referring to IList<T> documents
. I'm not sure why the decision was made to use IList<T>
there, but looking at documentation, I think that both FrozenSet<T>
and IList<T>
implement IEnumerable<T>
. So perhaps the best way to fix this is to change IList
@rossmills99 That might help, or preferably a separate extension method to intake the FrozenSet<T>
would be a better way. As a side note, typecasting to IList<T>
throws an exception and therefore .ToList()
had to be used.
Thanks. Yes, I think using the more general IEnumerable<T>
type here will be the best option - it then allows for any collection type that supports that interface, which includes FrozenSet<T>
, or anything that implements IList<T>
. This is better than creating overloads specific to any particular collection type. I can push up a quick PR.
@rossmills99 That's amazing. thanks for the prompt action.
FrozenSet<T>
is now shipped with .NET 8.0 and we started leveraging it. We have to convert our frozen sets toList<T>
using.ToList()
extension method when calling any of the methods in the title. It makes sense to introduce three more overloads of the aforementioned methods to support frozen sets in ArangoDB's .NET client library.