c# Programming Glossary: compare
Distinct() with lambda? http://stackoverflow.com/questions/1300088/distinct-with-lambda myCustomerList.Distinct someEqualityComparer The equality comparer argument must be an instance of IEqualityComparer T . I can.. problem you're going to run into is that when two objects compare equal they must have the same GetHashCode return value or else..
Nested using statements in C# http://stackoverflow.com/questions/1329739/nested-using-statements-in-c-sharp statements in C# I am working on a project and have to compare two files and see if they match eachother excatly. My first..
Does using “new” on a strict allocate it on the heap or stack? http://stackoverflow.com/questions/203695/does-using-new-on-a-strict-allocate-it-on-the-heap-or-stack significantly different IL. To understand why you need to compare the C# and CLI specs according to C# all value types have a..
LINQ - Fluent and Query Expression - Is there any benefit(s) of one over other? [closed] http://stackoverflow.com/questions/214500/linq-fluent-and-query-expression-is-there-any-benefits-of-one-over-other orderby fullName name select name came from fullName Now compare this to the same thing in method syntax var query fullNames..
Tips for optimizing C#/.NET programs [closed] http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs at the bottom for caveats on this. Use string.Compare to compare 2 strings instead of doing something like string1.ToLower string2.ToLower..
Regex for numbers only http://stackoverflow.com/questions/273141/regex-for-numbers-only never really done much with regular expressions. string compare 1234 4321 Regex regex new Regex @ d if regex.IsMatch compare.. 1234 4321 Regex regex new Regex @ d if regex.IsMatch compare true regex new Regex 0 9 if regex.IsMatch compare true In case.. compare true regex new Regex 0 9 if regex.IsMatch compare true In case it matters I'm using C# and .NET2.0. c# regex..
How do I use IValidatableObject? http://stackoverflow.com/questions/3400542/how-do-i-use-ivalidatableobject is used to validate an object in a way that let's one compare properties against each other. I'd still like to have attributes..
Can't operator == be applied to generic types in C#? http://stackoverflow.com/questions/390900/cant-operator-be-applied-to-generic-types-in-c two operands refer to the same object. For the string type compares the values of the strings. User defined value types can overload.. . . . Follow Up 2 I do want to point out that changing my compare method to static bool Compare T T x T y where T Test return..
Performance differences between debug and release builds http://stackoverflow.com/questions/4043821/performance-differences-between-debug-and-release-builds for example you profile the Debug build of your app and compare it to the Release build. That only really matters though when..
DateTime vs DateTimeOffset http://stackoverflow.com/questions/4331189/datetime-vs-datetimeoffset this analogy and some tips for keeping it straight If you compare two DateTimeOffset values they are first normalized to zero..
Differences in string compare methods in C# http://stackoverflow.com/questions/44288/differences-in-string-compare-methods-in-c-sharp in string compare methods in C# Comparing string in C# is pretty simple. In fact.. a culture dependant comparison. This might mean that will compare equal to SS in Germany or similar stringValue.Equals otherStringValue.. there are overloads with more options to specify how to compare. My advice if you just want to check for equality is to make..
How do the major C# DI/IoC frameworks compare? http://stackoverflow.com/questions/4581791/how-do-the-major-c-sharp-di-ioc-frameworks-compare do the major C# DI IoC frameworks compare At the risk of stepping into holy war territory What are the..
Comparing object properties in c# http://stackoverflow.com/questions/506096/comparing-object-properties-in-c-sharp comparisonObject null null if both are null don't try to compare throws exception else if sourceType.GetProperty pi.Name .GetValue..
In C#, why is String a reference type that behaves like a value type? http://stackoverflow.com/questions/636932/in-c-why-is-string-a-reference-type-that-behaves-like-a-value-type type such as being immutable and having overloaded to compare the text rather than making sure they reference the same object...
When should I use double instead of decimal? http://stackoverflow.com/questions/803225/when-should-i-use-double-instead-of-decimal warrant much thought however. In all cases if you want to compare two floating point numbers that should in theory be equivalent..
Difference Between Equals and == http://stackoverflow.com/questions/971954/difference-between-equals-and types of a and b are reference types In Java will always compare for identity i.e. whether the two values are references to the..
Compare two DataTables to determine rows in one but not the other http://stackoverflow.com/questions/164144/compare-two-datatables-to-determine-rows-in-one-but-not-the-other two DataTables to determine rows in one but not the other I..
Open source cad drawing (dwg) library in C# http://stackoverflow.com/questions/169390/open-source-cad-drawing-dwg-library-in-c-sharp for a developer is U 100 year with a U 250 joining fee. Compare that to AutoDesk's RealDWG at 2500 year and 5000 for the 1st..
C# variance problem: Assigning List<Derived> as List<Base> http://stackoverflow.com/questions/2033912/c-sharp-variance-problem-assigning-listderived-as-listbase in T because T is only used in an output position. Compare that with Action in T which is contravariant in T because T..
Natural Sort Order in C# http://stackoverflow.com/questions/248603/natural-sort-order-in-c-sharp sort in C# for an FileInfo array I am implementing the IComparer interface in my sorts. c# sorting file natural sort share.. in Windows and use it as the comparison function in your IComparer DllImport shlwapi.dll CharSet CharSet.Unicode private static.. string psz1 string psz2 public sealed class NaturalStringComparer IComparer string public int Compare string a string b return..
Can't operator == be applied to generic types in C#? http://stackoverflow.com/questions/390900/cant-operator-be-applied-to-generic-types-in-c types. So why does this code snippet fail to compile void Compare T T x T y return x y I get the error Operator ' ' cannot be.. However this will compile because it is more explicit bool Compare T T x T y where T class return x y Follow up to additional.. Inline bool x a b Console.WriteLine Generic Compare Test a b static bool Compare T T x T y where T class return..
Compare using Thread.Sleep and Timer for delayed execution http://stackoverflow.com/questions/391621/compare-using-thread-sleep-and-timer-for-delayed-execution using Thread.Sleep and Timer for delayed execution I have a..
Comparing object properties in c# http://stackoverflow.com/questions/506096/comparing-object-properties-in-c-sharp scrutiny. How can it be better more efficient etc. summary Compare property values as strings summary param name obj param returns..
Implementing Audit Log / Change History with MVC & Entity Framework http://stackoverflow.com/questions/6867459/implementing-audit-log-change-history-with-mvc-entity-framework to build the model when originally displaying the form Compare with old view model WriteChanges uneditedVM vm ... TryUpdateModel..
Use own IComparer<T> with Linq OrderBy http://stackoverflow.com/questions/985657/use-own-icomparert-with-linq-orderby own IComparer T with Linq OrderBy I have a generic List MyClass where MyClass.. 2 which is nasty in this case. Now I want to use my own IComparer T with this. It looks like this public class MyComparer IComparer.. IComparer T with this. It looks like this public class MyComparer IComparer Object public int Compare Object stringA Object stringB..
Hows to quick check if data transfer two objects have equal properties in C#? http://stackoverflow.com/questions/986572/hows-to-quick-check-if-data-transfer-two-objects-have-equal-properties-in-c c new Report Id 1 ProjectId 12 Console.WriteLine PropertyCompare.Equal a b Console.WriteLine PropertyCompare.Equal a c static.. PropertyCompare.Equal a b Console.WriteLine PropertyCompare.Equal a c static class PropertyCompare public static bool Equal.. PropertyCompare.Equal a c static class PropertyCompare public static bool Equal T T x T y return Cache T .Compare x..
|