Skip to content

Instantly share code, notes, and snippets.

@lazypower
Created August 29, 2012 03:45
Show Gist options
  • Save lazypower/3506605 to your computer and use it in GitHub Desktop.
Save lazypower/3506605 to your computer and use it in GitHub Desktop.
vomit
public static object OccupationResultsFromAOI(string AreaOfInterest)
{
using (var db = new sandboxEntities())
{
var output = (from careermaps in db.CareerMaps
where
(from occupathbridges in db.OccuPathBridges
where
(from programcategories in db.ProgramCategories
where
programcategories.AreaOfInterestInterestID ==
((from areaofinterests in db.AreaOfInterests
where
areaofinterests.InterestTitle == AreaOfInterest
select new
{
areaofinterests.InterestID
}).FirstOrDefault().InterestID)
select new
{
programcategories.CategoryID
}).Contains(new { CategoryID = (Int32)occupathbridges.ProgramCategoryID })
group occupathbridges by new
{
occupathbridges.OccupationID
} into g
select new
{
OccupationID = (Int32?)g.Key.OccupationID
}).Contains(new { careermaps.OccupationID })
select new
{
careermaps.OccupationTitle
}).Distinct();
if (output != null)
{
return (object)output.ToList();
}
else
{
return null;
}
} //end using
}//end occupation results from aoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment