Skip to content

Instantly share code, notes, and snippets.

@mbmccormick
Created August 31, 2012 16:09
Show Gist options
  • Save mbmccormick/3555204 to your computer and use it in GitHub Desktop.
Save mbmccormick/3555204 to your computer and use it in GitHub Desktop.
Shit that annoys me.
public int FetchMediumType(string device)
{
SQLSelect select = new SQLSelect(Connection);
select.Columns("MediumType");
select.From("dbo.Links");
select.Distinct = true;
select.Where("FromPort", Op.Like, device)
.Or("ToPort", Op.Like, device);
return select.ExecuteScalar<int>();
}
public int FetchMediumTypeFromString(string type)
{
SQLSelect select = new SQLSelect(Connection);
select.Columns("PK");
select.From("dbo.MediumType");
select.Distinct = true;
select.Where("MediumType", Op.Equal, type);
return select.ExecuteScalar<int>();
}
@mgroves
Copy link

mgroves commented Aug 31, 2012

A region!? Bleh!

@swanson
Copy link

swanson commented Aug 31, 2012

regions, hiding bad code since 2003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment