c# - convert type "system collection generic.iList to long[]" -
c# - convert type "system collection generic.iList<long> to long[]" -
please help me integrating bing app in application. have got error "system collection generic.ilist<long> long[]". below addcampaigns function:
static long[] addcampaigns(long accountid, campaign[] campaigns) { var request = new addcampaignsrequest { // set header information. username = *******, password = *******, developertoken = developertoken, customeraccountid = accountid.tostring(cultureinfo.invariantculture), authenticationtoken = "ewb4anhlbaaulzly8ml8fhdf5bgndempxpxcgikaar6ffh6gzgnglmckp+g72lrhoq+nsiyssxhsplwp8xz/dbyjlgshhupfyswjnewclbjfug/htzyrz5m8ztkqw1lsspl76h5wfn5cjug3pwwem6yl4tdqxlektcebyzgxxcns+iwxwzaaeuxwenagl2fdw/avyg1dpcagvz8h1up833sizwhabx1hsbdwmxjqodqwy0wubuczifoxs4tjchhqwrnhre1fkjnqgoqpmnpsiu8fnoreehpmtrq84xsori5gj2nytwja2oibxggxd15b4jj6upsr1gbrnawaq6lfp2htekze/c7rl49evxdxfmvf2kdhysqgrfik5i3v7y4dzgaacg16wwzkc/17safuxssuzqd3wedqmikajmysvsui0hwnf1m9mmq6j8giqiuiscmj87wn+lbrx5wb8urnhcffvxkunvjl7+a0oy7nvzkt43alck9dxpf9f00dmvndntv1omgzv3srmulkx7rjxa2rmg72la69qdrc3znruwg0ioagheljt6unlaecopjkg3zqtyd5yjjlxxodjogucl8hzjkgaj7ul/xvzrve8hstqdvvffmnqkmiljkrpj30o+61tw7ppiyw4c/felo9v2/19y/uwyg0la42bhmx2e7wiz9w1jjsbq5ptewwrz7aho5rkwuh6wombtbvwcc4z+ff6y0kyujjuupv6zj4r3aex9xe6zhalqt+jcplswrqvgly7tbdb7eljravgz0emrrsso0pmqra/iujjp/vlxz52kquv4f03esn92kliyd9cyffhfd+xge=", // set request information. accountid = accountid, campaigns = campaigns }; homecoming _service.addcampaigns(request).campaignids; }
thanks in advance.
assuming title campaignids
ilist<long>
can utilize linq's toarray()
prepare issue
using system.linq; //... homecoming _service.addcampaigns(request).campaignids.toarray();
if campaignids
needs sort of translation, add together .select()
before toarray()
//... homecoming _service.addcampaigns(request).campaignids .select(id => /** translation work **/ ) .toarray();
you should consider utilize of long[]
against sinple ienumerable<long>
depending on usage - there overhead using .toarray
avoided if don't need array-specific functionality out of result.
c# bing-api
Comments
Post a Comment