HI,
Ive got the following question. I already got this part working but i want to do it a more nice way.
now i get a customer witch contains a list of customers ( actually 1).
using a linq query i can get the firstname, lastname, adress wich are all strings.
Now i made this function so it won't be done in the form but on its businessLogic, but i'm kinda stuck. i;m doing something wrong here but can't figger out what.
public List GetValuesBySelectedCustomer(List items)
{
// test
var firstname= items.Select(i => i.firstname).ToList();
var lastname= items.Select(i => i.lastname).ToList();
var street= items.Select(i => i.street).ToList();
{
// test
var firstname= items.Select(i => i.firstname).ToList();
var lastname= items.Select(i => i.lastname).ToList();
var street= items.Select(i => i.street).ToList();
return new List{firstname, lastname, street};
}
I get the following error.
Using the generic type 'List
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitin SontakkePosted Feb 15, 2017, 10:23 PM
Nilesh ShahPosted Feb 15, 2017, 12:31 PM
Nilesh ShahPosted Feb 13, 2017, 5:44 PM
, List, List> instead of List.
, List, List> GetValuesBySelectedCustomer(List items)
{
// test
var firstname = items.Select(i => i).ToList();
var lastname = items.Select(i => i).ToList();
var street = items.Select(i => i).ToList();
return new Tuple
, List, List>(firstname, lastname, street);
}
Tapan PatelPosted Feb 13, 2017, 9:06 AM