This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace Mantle.Extensions | |
{ | |
public static class EnumerableExtensions | |
{ | |
public static IOrderedEnumerable<T> Order<T>(this IEnumerable<T> source) | |
{ | |
if (source == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
namespace Extensions | |
{ | |
public static class FunctionalStringSplitExtension | |
{ | |
public static string[] Split(this string source, Func<char, bool> splitOn) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool None<T>(this IEnumerable<T> source, Func<T, bool> condition = null) | |
{ | |
return (source.Any(condition ?? (t => true)) == false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool OnlyOne<T>(this IEnumerable<T> source, Func<T, bool> condition = null) | |
{ | |
return (source.Count(condition ?? (t => true)) == 1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns"> | |
<!-- Do not reorder COM interfaces --> | |
<Pattern> | |
<Match> | |
<And Weight="100"> | |
<Kind Is="interface" /> | |
<HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute" /> | |
</And> | |
</Match> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.Data.SqlTypes; | |
using Microsoft.SqlServer.Server; | |
using System.Net; | |
public partial class UserDefinedFunctions | |
{ | |
[Microsoft.SqlServer.Server.SqlFunction] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @min BIGINT = 9989 | |
DECLARE @max BIGINT = 21899 | |
DECLARE @minX FLOAT = -118.3876873 | |
DECLARE @maxX FLOAT = -87.55091344 | |
DECLARE @minY FLOAT = 30.195573 | |
DECLARE @maxY FLOAT = 42.010291 | |
WHILE (@min < @max) BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data.Entity.Design.PluralizationServices; | |
using System.Globalization; | |
using System.Text; | |
namespace Modelio.Core | |
{ | |
public static class StringExtensions | |
{ | |
public static string Pluralize(this string source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool IsValidXmlDocument(this string source) | |
{ | |
try | |
{ | |
var document = XDocument.Parse(source); | |
return true; | |
} | |
catch | |
{ | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace SpaceX.CDL.Core | |
{ | |
public class FunctionalEqualityComparer<T> : IEqualityComparer<T> | |
{ | |
private readonly Func<T, T, bool> comparisonFunction; | |
public FunctionalEqualityComparer(Func<T, T, bool> comparisonFunction) |