C
C#4d ago
unifpe

Distinct List in List of Lists

1,1].Distinct() returns [1] [[1],[1]].Distinct() returns [[1],[1]] what to do ?
2 Replies
unifpe
unifpe4d ago
I need this only for numeric values public class ListComparer : IEqualityComparer<List<long>> { public bool Equals(List<long> x, List<long> y) { if (x.Count != y.Count) return false; for (int i = 0; i < x.Count; i++) if (x[i] != y[i]) return false; return true; } public int GetHashCode(List<long> x) => x.Count; } How to do this for generic real number type using numeric types ?
Want results from more Discord servers?
Add your server
More Posts
✅ System Exception cannot figure out why it's happeningHello, I have several DataViewGrids that I am binding data to. I'm binding objects from inside of thWhich object creation method is more used?I've started learning C# recently and I am wondering which way of object creation is more acceptableHow to link C++ library to C#, and make C++ library cannot to decompile?I make some CLR Class Library with C++. But when i using dotpeek, it still decompiled. How to make i"ReferencePath" item list does not define a value for the "CopyLocal" metadataHi there,I am making a form application with C# and after downloading Iot.Device.Bindings System.DevUnit Testing | Unsupported expression: ht => ht.LoadAll<ReasonType>()Non-overridable membersanyone know how to fix this error? here a function i tried to test ```c++ public List<ReasonType> GRegister user doesnt work (MySQL)Hey, im new to databases and just wanted to learn how to work with them. But every time I regsiter a✅ How To Pass A String or LoginModel back through navigation Avalonia.MVVMLoginView.axaml: https://pastebin.com/hnwBdAe9 MainWindowViewModel.cs: https://pastebin.com/6LMgkL0cKestrel https url binding warningI have the testapplication in screenshot 1. on startup i get a warning that i want to understand and.Add() and .Update() aren't working, why though?I am much newer to CRUD applications and here are my base classes: ```C# using System.Data.Common; uWPF - Using RTF as a Notes section.I have been able to get the note to write to the database but im having troubles calling the right e