How to do SQL Like % in Linq?
.Where(oh => oh.Hierarchy.Contains(“/12/”)) You can also use .StartsWith() or .EndsWith().
.Where(oh => oh.Hierarchy.Contains(“/12/”)) You can also use .StartsWith() or .EndsWith().
eta: There’s a killer article on this stuff by SO’s own @Nick Craver that you should read While the other responses say this, they don’t make it explicit, so I will…. On VS2013.2, to actually trigger the emission of the cited information, you need to not read the message, which says: C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning … Read more
Updated 13th December 2011 The following open source tools are available: ILSpy from the SharpDevelop team. Thanks to Scott Hanselman’s tweet highlighting the tool. Dotnet IL Editor (a disassembler) IL.View – a .NET Reflector alternative written in Silverlight 4 as an Out-of-Browser Silverlight Application. See this blog post for details.
You should use .NET Core, instead of .NET Framework or Xamarin, in the following 6 typical scenarios according to the documentation here. 1. Cross-Platform needs Clearly, if your goal is to have an application (web/service) that should be able to run across platforms (Windows, Linux and MacOS), the best choice in the .NET ecosystem is … Read more
I’d use the word ‘return‘ to remember, the r comes before the n.
Change the “MSBuild project build output verbosity” to “Detailed” or above. To do this, follow these steps: Bring up the Options dialog (Tools -> Options…). In the left-hand tree, select the Projects and Solutions node, and then select Build and Run. Note: if this node doesn’t show up, make sure that the checkbox at the … Read more
It depends on how you format the Guid: Guid.NewGuid().ToString() = 36 characters (Hyphenated) outputs: 12345678-1234-1234-1234-123456789abc Guid.NewGuid().ToString(“D”) = 36 characters (Hyphenated, same as ToString()) outputs: 12345678-1234-1234-1234-123456789abc Guid.NewGuid().ToString(“N”) = 32 characters (Digits only) outputs: 12345678123412341234123456789abc Guid.NewGuid().ToString(“B”) = 38 characters (Braces) outputs: {12345678-1234-1234-1234-123456789abc} Guid.NewGuid().ToString(“P”) = 38 characters (Parentheses) outputs: (12345678-1234-1234-1234-123456789abc) Guid.NewGuid().ToString(“X”) = 68 characters (Hexadecimal) outputs: {0x12345678,0x1234,0x1234,{0x12,0x34,0x12,0x34,0x56,0x78,0x9a,0xbc}}
There’s no built in method to do that. You can use the expression: (date1 > date2 ? date1 : date2) to find the maximum of the two. You can write a generic method to calculate Min or Max for any type (provided that Comparer<T>.Default is set appropriately): public static T Max<T>(T first, T second) { … Read more
32-bit %windir%\Microsoft.NET\Framework\[version]\config\machine.config 64-bit %windir%\Microsoft.NET\Framework64\[version]\config\machine.config [version] should be equal to v1.0.3705, v1.1.4322, v2.0.50727 or v4.0.30319. v3.0 and v3.5 just contain additional assemblies to v2.0.50727 so there should be no config\machine.config. v4.5.x and v4.6.x are stored inside v4.0.30319.
First of all, IQueryable<T> extends the IEnumerable<T> interface, so anything you can do with a “plain” IEnumerable<T>, you can also do with an IQueryable<T>. IEnumerable<T> just has a GetEnumerator() method that returns an Enumerator<T> for which you can call its MoveNext() method to iterate through a sequence of T. What IQueryable<T> has that IEnumerable<T> doesn’t … Read more