valuetuple Questions

1

Solved

I would like to use the naming feature of ValueTuple as follows: IEnumerable<(string, char, int)> valueTuples = new(string, char, int)[] { ("First", '1', 1), ("Second", '2', 2), ("Third...
Olli asked 28/4, 2018 at 4:11

1

Solved

The documentation for ValueTuple.IComparable.CompareTo(Object) says it returns: 0 if other is a ValueTuple instance; otherwise, 1 if other is null. This makes the IComparable implementation se...
Durr asked 13/2, 2018 at 11:12

2

Solved

Since C# 7 introduces value tuples, is there a meaningful scenario where they are better suited than tuples? For example, the following line collection.Select((x, i) => (x, i)).Where(y => a...
Inquisitionist asked 30/6, 2017 at 16:23

1

The new ValueTuple types in C# 7 implement IComparable, but the only documentation I have been able to find on their implementation of this simply states that CompareTo's return value indicates rel...
Quinary asked 18/10, 2017 at 5:47

3

Solved

I'm trying ValueTuple Class in C#, and i have a doubt about properties naming, let's see: If instantiate a ValueTuple declaring the object like this: var tuple1 = (Name: "Name1", Age: 25); We can ...
Caren asked 6/10, 2017 at 8:35

1

Solved

I have a combobox and want to bind its ItemsSource to an IEnumerable<(string,string)>. If I do not set DisplayMemberPath, then it works and it shows in the dropdown area the result of c...
Moskowitz asked 2/8, 2017 at 18:35

3

Solved

If I have a viewmodel property public (string Mdf, string MdfPath) MachineDefinition { get; set; } and I try to bind to it in XAML / WPF <Label Content="{Binding Path=MachineDefinition.Item2...
Rambow asked 4/4, 2017 at 13:36

3

Solved

Fiddle here. Given a function (string a, string b) F(), you can deconstruct the tuple it returns: var (a, b) = F(); (string c, string d) = F(); Or you can just assign it: var (a, b) e = F(); ...
Westernmost asked 11/5, 2017 at 16:6

1

Solved

why binding to ValueTuple property members (like Item1, Item2 ect) dont work? <TextBlock x:Name="txtTest" Text="{Binding Item1}" /> the code: txtTest.DataContext = ("Item A", "Anoth...
Schalles asked 15/6, 2017 at 11:5

1

Solved

I played around with the ValueTuple structure and tried to implement an immutable composite key. The key is composed of value types. I tried to break the following implementation with some unit tes...
Dissected asked 8/5, 2017 at 16:15

2

Solved

I want to Map a ValueTuple to a class using reflection. Documentation says that there is a Attribute attached to ValueTuple with parameters names (others than Item1, Item2, etc...) but I can't see ...
Puzzlement asked 19/4, 2017 at 7:11

1

Solved

Can the new feature in C# 7.0 (in VS 2017) to give tuple fields names be translated to KeyValuePairs? Lets assume I have this: class Entry { public string SomeProperty { get; set; } } var allEn...
Demolish asked 7/4, 2017 at 15:51

© 2022 - 2024 — McMap. All rights reserved.