🏃♂️
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.Linq; | |
namespace Extensions | |
{ | |
public static class IEnumerableExtensions | |
{ | |
// e.g. bool sameList = list1.Equals(list2, entity => entity.Id) |
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.Linq; | |
using System.Reflection; | |
namespace Reflection | |
{ | |
public interface IGenericInterface<T> | |
{ | |
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.Reflection; | |
namespace Caching | |
{ | |
public abstract class CachedServiceBase<T> where T : class | |
{ | |
private static readonly object Lock = new object(); | |
protected ICacheProvider<T> Cache; |
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; | |
namespace Extensions | |
{ | |
public static class TypeExtensions | |
{ | |
public static bool IsSubclassOfRawGeneric(this Type type, Type generic) | |
{ | |
if (null == generic) | |
{ |
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.Linq; | |
namespace Extensions | |
{ | |
public static class IEnumerableExtensions | |
{ | |
public static IEnumerable<TSource> WhereIf<TSource>(this IEnumerable<TSource> source, bool condition, Func<TSource, bool> predicate) | |
{ |
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; | |
namespace Extensions | |
{ | |
public static class DateTimeExtensions | |
{ | |
public static bool ApproximatelyEqual(this DateTime t, DateTime obj) | |
{ | |
return Math.Abs((t - obj).TotalSeconds) < 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
using FluentNHibernate.Conventions; | |
using FluentNHibernate.Conventions.Instances; | |
namespace Data | |
{ | |
public class RowVersionConvention : IVersionConvention | |
{ | |
public void Apply(IVersionInstance instance) | |
{ | |
instance.Column("RowVersion"); |
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
# script courtesy of Per Ivar Jørgensen Seterlund @ http://code.seterlund.com/2011/05/disable-password-policies-in-adlds-adam.html | |
dsmgmt "Configurable Settings" Connections "connect to server localhost:389" q "Set ADAMDisablePasswordPolicies to 1" "Commit changes" q q |
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; | |
namespace Extensions | |
{ | |
/// <summary> | |
/// Contains <see cref="object"/> extension methods. | |
/// </summary> | |
public static class ObjectExtensions | |
{ | |
/// <summary> |
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
namespace Extensions | |
{ | |
/// <summary> | |
/// Extension methods for classes that implement the <see cref="IEnumerable"/> interface. | |
/// </summary> | |
public static class IEnumerableExtensions | |
{ | |
/// <summary> | |
/// Converts the collection to an array that is guaranteed not to be proxied. | |
/// </summary> |
OlderNewer