c# get all elements from list
You could get the Customers like this:
using System.Linq;
collectionCarts.SelectMany(c => c.OrderList.Select(o => o.Customer));
c# get all elements from list
You could get the Customers like this:
using System.Linq;
collectionCarts.SelectMany(c => c.OrderList.Select(o => o.Customer));
c# get a value from value tuple list
// Using this extension method you can get the value you wish
static string GetAttributeValue(this IEnumerable<(string key, string value)> attributes, string attribute) =>
attributes.Where(x => x.key == attribute).First().value;
// Obviously this does not work if you have multiple values that are the same
// So, NOTE that this assumes that you want to get the first occurance
// Usage:
List<(string, string)> values = new List<(string, string)>()
{ ("asd", "asd"), ("asd1", "asd1") };
string asdValue = values.GetAttributeValue("asd1");
// Output: asd1
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us