Nullable extension: Has Value And Equals
//http://arolibraries.codeplex.com/
//The MIT License (MIT)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AroLibraries.ExtensionMethods
{
public static class NullableExt
{
public static bool Ext_HasValueAndEquals<T>(this Nullable<T> source, T target) where T : struct
{
return source.HasValue && source.Value.Equals(target);
}
public static bool Ext_HasValueAndEquals<T>(this Nullable<T> source, Nullable<T> target) where T : struct
{
return source.HasValue && source.Value.Equals(target);
}
}
}
Related examples in the same category