Skip to content

Instantly share code, notes, and snippets.

@mbmccormick
Created August 31, 2012 16:09
Show Gist options
  • Select an option

  • Save mbmccormick/3555204 to your computer and use it in GitHub Desktop.

Select an option

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>();
}
@mbmccormick

Copy link
Copy Markdown
Author

And for the record, this is NOT my code...

@mgroves

mgroves commented Aug 31, 2012

Copy link
Copy Markdown

A region!? Bleh!

@swanson

swanson commented Aug 31, 2012

Copy link
Copy Markdown

regions, hiding bad code since 2003

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