Skip to content

Instantly share code, notes, and snippets.

View cmc19's full-sized avatar

cmc19

  • SSD Technology Partners
  • Delaware, USA
View GitHub Profile
@sharwell
sharwell / nuspec.md
Last active November 10, 2024 16:46
A schema definition for NuGet specifications suitable for use with Visual Studio's IntelliSense.

A schema definition for NuGet specifications suitable for use with Visual Studio's IntelliSense.

Installation

To use this file:

  1. Download the file to your Visual Studio XML schemas folder. For example:
    • Visual Studio 2010: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas
    • Visual Studio 2012: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Xml\Schemas
  2. Make sure to specify the XML namespace in your .nuspec file. If you previously used , change it to
@Termiux
Termiux / gist:6115547
Last active May 17, 2024 03:09
Gets the Maximum Length of a column table in Entity Framework 5
/// <summary>
/// Gets the Maximum Length of a column table in Entity Framework 5
/// Original from SO:
/// http://stackoverflow.com/questions/12378186/entity-framework-5-maxlength/12964634#12964634
/// You need to add a reference to System.Linq.Expressions
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="column"></param>
/// <returns></returns>
public static int GetColumnMaxLength<T>(Expression<Func<T, string>> column)
public abstract class ExpressionVisitorBase<TState>
{
public class ExpressionNotSupportedException : Exception
{
public ExpressionNotSupportedException(Expression expression) :
base(string.Format("Expression {0} not supported.", expression.GetType().Name)) { }
}
public virtual TState Visit(Expression node)
{