private object DoUnknown(BaseName name)
 {
     return new
     {
         uniqueID = name.itemID,
         uniqueName = name.itemName,
         name.typeID,
         name.itemName,
         name.itemID,
         name.groupID,
         category = name.categoryID
     };
 }
 private object DoSystem(BaseName name)
 {
     var system = from i in dataContext.mapSolarSystems
                  where i.solarSystemID == name.itemID
                  from c in dataContext.mapConstellations
                  where i.constellationID == c.constellationID
                  from r in dataContext.mapRegions
                  where i.regionID == r.regionID
                  select new
                  {
                      uniqueID = i.solarSystemID,
                      uniqueName = i.solarSystemName,
                      i.solarSystemID,
                      i.solarSystemName,
                      i.border,
                      i.constellation,
                      i.constellationID,
                      i.corridor,
                      i.factionID,
                      i.fringe,
                      i.hub,
                      i.international,
                      i.luminosity,
                      i.radius,
                      i.regional,
                      i.regionID,
                      i.security,
                      i.securityClass,
                      i.sunTypeID,
                      i.x,
                      i.xMax,
                      i.xMin,
                      i.y,
                      i.yMax,
                      i.yMin,
                      i.z,
                      i.zMax,
                      i.zMin,
                      Constellation = c,
                      Region = r
                  };
     return (system.Count() > 0) ? system.First() : null;
 }
 private object DoName(BaseName name)
 {
     switch ((GroupNames)name.groupID)
     {
         case GroupNames.Character:
         case GroupNames.Corporation:
         case GroupNames.Faction:
         case GroupNames.Neutral_Object_Oriented_bastards:
         default:
             return DoUnknown(name);
     }
 }
 private object DoNpc(BaseName name)
 {
     // Grab agents
     var agents = from i in dataContext.agtAgents
                  where i.agentID == name.itemID
                  // Join info about agents (qual)
                  join c in dataContext.agtConfigs on i.agentID equals c.agentID
                  join r in dataContext.agtResearchAgents on i.agentID equals r.agentID
                  join t in dataContext.agtAgentTypes on i.agentTypeID equals t.agentTypeID
                  join n in dataContext.eveNames on i.agentID equals n.itemID
                  select new
                  {
                      Agents = i,
                      Configs = c,
                      ResearchAgents = r
                  };
     return agents.ToList();
 }
 private object DoCelestial(BaseName name)
 {
     switch ((GroupCelestials)name.groupID)
     {
         case GroupCelestials.Region:
         case GroupCelestials.Constellation:
         case GroupCelestials.Star:
         case GroupCelestials.Planet:
         case GroupCelestials.Moon:
         case GroupCelestials.Asteroid_Belt:
         case GroupCelestials.Station:
         default:
             return DoUnknown(name);
         case GroupCelestials.Solarsystem:
             return DoSystem(name);
     }
 }