public async Task <List <AkeneoBatchResponse> > CreateOrUpdateAsync <TModel>(IEnumerable <TModel> model, CancellationToken ct = default(CancellationToken)) where TModel : ModelBase { var option = model.FirstOrDefault() as AttributeOption; var endpoint = _endpointResolver.ForResourceType <TModel>(option?.Attribute); _logger.Debug($"Updating or creating resource '{typeof(TModel).Name}' from URL '{endpoint}'."); var response = await PatchAsJsonCollectionAsync(endpoint, model, ct); var contentStr = await response.Content.ReadAsStringAsync(); return(AkeneoCollectionSerializer.Deserialize <AkeneoBatchResponse>(contentStr).ToList()); }
private static string Convert(IEnumerable <TType> content) { return(AkeneoCollectionSerializer.Serialize(content)); }