Skip to content

Instantly share code, notes, and snippets.

@NickCraver
Created January 22, 2016 13:58
Show Gist options
  • Save NickCraver/8830d88dea98b41be652 to your computer and use it in GitHub Desktop.
Save NickCraver/8830d88dea98b41be652 to your computer and use it in GitHub Desktop.
LinqPad switch implementation test
void Main() { }
public class DbColumn
{
private readonly Dictionary<string, object> _customValues = new Dictionary<string, object>();
public virtual bool AllowDBNull { get; set; }
public virtual string BaseCatalogName { get; set; }
public virtual string BaseColumnName { get; set; }
public virtual string BaseSchemaName { get; set; }
public virtual string BaseServerName { get; set; }
public virtual string BaseTableName { get; set; }
public virtual string ColumnName { get; set; }
public virtual int ColumnOrdinal { get; set; }
public virtual int ColumnSize { get; set; }
public virtual bool IsAliased { get; set; }
public virtual bool IsAutoIncrement { get; set; }
public virtual bool IsExpression { get; set; }
public virtual bool IsHidden { get; set; }
public virtual bool IsIdentity { get; set; }
public virtual bool IsKey { get; set; }
public virtual bool IsLong { get; set; }
public virtual bool IsReadOnly { get; set; }
public virtual bool IsUnique { get; set; }
public virtual int NumericPrecision { get; set; }
public virtual int NumericScale { get; set; }
public virtual string UdtAssemblyQualifiedName { get; set; }
public virtual Type DataType { get; set; }
public virtual string DataTypeName { get; set; }
public virtual object this[string property]
{
get
{
switch (property)
{
case nameof(AllowDBNull):
return AllowDBNull;
case nameof(BaseCatalogName):
return BaseCatalogName;
case nameof(BaseColumnName):
return BaseColumnName;
case nameof(BaseSchemaName):
return BaseSchemaName;
case nameof(BaseTableName):
return BaseTableName;
case nameof(ColumnName):
return ColumnName;
// case nameof(ColumnOrdinal):
// return ColumnOrdinal;
// case nameof(ColumnSize):
// return ColumnSize;
// case nameof(IsAliased):
// return IsAliased;
// case nameof(IsAutoIncrement):
// return IsAutoIncrement;
// case nameof(IsExpression):
// return IsExpression;
// case nameof(IsHidden):
// return IsHidden;
// case nameof(IsIdentity):
// return IsIdentity;
// case nameof(IsKey):
// return IsKey;
// case nameof(IsLong):
// return IsLong;
// case nameof(IsReadOnly):
// return IsReadOnly;
// case nameof(IsUnique):
// return IsUnique;
// case nameof(NumericPrecision):
// return NumericPrecision;
// case nameof(NumericScale):
// return NumericScale;
// case nameof(UdtAssemblyQualifiedName):
// return UdtAssemblyQualifiedName;
// case nameof(DataType):
// return DataType;
// case nameof(DataTypeName):
// return DataTypeName;
}
return null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment