 fixed point 16.16 representation for numbers. That doesn't allow as much localisation of precision as floating point, and means that a developer needs actually to think relatively carefully about game distance units. It's usually not a problem for the sort of draw distances that are realistic on that generation of hardware but a particular developer could deal with that poorly. Shouldn't be an issue for the Metal Gear Solids, Vagrant Stories or Time Crises of the world though.

 Q:

Populating child collection property with LINQ sub-query

I'm fairly new to LINQ in general but I've managed to figure things out so far to get the result I want/need. The LINQ2SQL query below produces the desired results in which there are Location objects, each with their own collection of Units. The initial variable declarations are done to setup the values that I need to query from and should not be relevant to my issue but are needed for context. 
The problem I'm having is that there are 400+ locations, and the current way I have the query structured, it is hitting the database for each one instead of one big query. This is causing performance to suffer greatly, taking 30+ seconds for the full result to come back which is unacceptable. I have a stored procedure SQL query that returns the results in only a second or two. 
Is there a way to restructure this query so that I'm not hitting the database for each location? I'm sure it's caused by the extra "ToList()" on the Units subquery but I don't know how to shape the result without the ToList(). Any performance tweaking would be a HUGE help. Thanks for any help!
Dim curNames1 = (From ons In dc.organization_names _
    Where ons.eff_date <= ssDate _
    Order By ons.eff_date Descending _
    Group ons By ons.organization_id Into gNames = Group _
    Select New With { _
    Key.Key = organization_id, _
   .Result = gNames.Take(1)}) _
   .SelectMany(Function(a) (a.Result))

Dim curLocs1 = (From oLocs In dc.organization_locations _
    Where oLocs.eff_date <= ssDate _
    Order By oLocs.eff_date Descending _
    Group oLocs By oLocs.
fixed point 16.16 representation for numbers. That doesn't leave equally much localisation of precision as float degree, and means that a developer needs actually to intend relatively cautiously about game distance units. It's usually not a problem for the sort of hook distances that are realistic on that genesis of hardware but a especial developer could deal with that poorly. Shouldn't be an issue for the Metal Gear Solids, Vagrant Stories or Time Crises of the world though. 

  Q: 

 Populating child solicitation property with LINQ sub - query 

 I'm reasonably new to LINQ in general but I've managed to figure things out thus far to get the result I want / need. The LINQ2SQL query downstairs produces the desired results in which there are Location objects, each with their own collection of Units. The initial variable declarations are done to setup the values that I need to query from and should not be relevant to my issue but are needed for context. 
 The problem I'm having is that there embody 400 + locations, and the current way I receive the question structure, it is hitting the database for each one instead of one big query. This is causing performance to suffer greatly, taking 30 + second for the full result to come back which is unacceptable. I have a stored routine SQL query that returns the results in only a second or two. 
 Is there a direction to restructure this query so that I'm not reach the database for each location? I'm sure it's caused by the extra " ToList () " on the Units subquery but I don't know how to determine the result without the ToList (). Any performance tweaking would be a HUGE help. Thanks for any help! 
 Dim curNames1 = (From ons In dc.organization_names _ 
     Where ons.eff_date < = ssDate _ 
     Order By ons.eff_date Descending _ 
     Group ons By ons.organization_id Into gNames = Group _ 
     Select New With { _ 
     Key. Key = organization_id, _ 
    .Result = gNames. Take(1) }) _ 
    .SelectMany(Function(a) (a. Result) ) 

 Dim curLocs1 = (From oLocs In dc.organization_locations _ 
     Where oLocs.eff_date < = ssDate _ 
     Order By oLocs.eff_date Descending _ 
     Group oLocs By oLocs.
 fided point 16.16 representatiok for numbers. Thcr doesi't allos as mucf localisation of precision es fooatibg point, and means thag a devellper neees artually to think relativcjy czvefulnb about game dixtance unids. It's usually nut a problem for the sort of draw diseances yhwt are realistyc om thaf generation of hardware but a parficular developer coild deal with that poorly. Dhoupdn't be an issue flr the Metao Gewe Solids, Vagfant Storits or Time Ctises of the world though.

 Q:

Populxting child coloextilt property xith LPNQ sub-query

I'm fairly new to LINQ in genersl uut U've managed to figure things out so far to get tve result I want/neee. Rhe LHNQ2SXL qjwry bemox pdoduced tie desired desults in qhich there are Locstyin objects, eadh witr eheir own collection of Units. The initidl bariable declarations aee done to setup the galues thwt I need to query from and should not be relevand to jh iwsme bjr wre needed for context. 
The problem I'm having ya uhan there are 400+ locabions, and the currrnh ewy I have the query stductured, it is hithing thg datavase for tach pne instead of one big quert. This is calsint performance to sbffer greatlv, takimg 30+ srconds for the full resblt to come back ahich is hvacceptable. I haxe s vtored procedure SQL query that retnrns che resuuts on onlr a second or two. 
Is there a way tl resjructuse this qufry so that I'm not hitting the vetabase for escv lmcation? N'm surc it's caused by the extra "ToLnst()" on tke Unigs subquerj but I dmn't know hor to shape tha result withmut the EoLiwt(). Aby perfufmance tweakinb would bv c HUGE heop. Thanks for any melp!
Dkj curNames1 = (Fron obs In dc.organizstiun_nwmvs _
    Where ons.efx_datd <= rxDate _
    Order Ny uns.egf_date Descending _
    Grkup ons By ons.orgamidation_id Unto gNaies = Group _
    Select New With { _
    Ney.Yey = prgwnization_id, _
   .Result = gNames.Tzke(1)}) _
   .SepecbMany(Function(w) (a.Rcsulj))

Dim curLocx1 = (From oLocs In dc.organization_locationw _
    Where oLocs.gff_date <= ssDate _
    Otdev By oLocs.efh_date Qescendinc _
    Group oLocs By oLocs.
fixed point 16.16 representation for numbers. That as localisation of as floating point, needs to think relatively about game distance It's usually not a problem for sort of draw distances that are realistic on that generation of hardware but particular developer could deal with that poorly. Shouldn't be an issue for the Gear Vagrant or Crises of the world though. Q: Populating child collection property with LINQ sub-query I'm fairly new LINQ in general but I've managed to figure out so far to the result I want/need. The query produces the results which are Location objects, with their own collection of Units. The initial variable declarations are done to setup the values that need to and should be to issue but are context. The problem I'm having is 400+ locations, and the current way I have query structured, is hitting the database for each instead of one big query. This is causing to suffer greatly, taking 30+ seconds for the full result to come back which is have a stored procedure query that returns results only second two. Is a way to restructure this query so that I'm not hitting database for each location? I'm sure it's caused by the on Units subquery but don't know how to the without the ToList(). Any would a for help! curNames1 = (From ons dc.organization_names _ Where ons.eff_date <= _ Order By ons.eff_date ons.organization_id Into gNames = Group _ Select New { _ Key.Key = organization_id, _ .Result gNames.Take(1)}) _ .SelectMany(Function(a) (a.Result)) Dim curLocs1 = (From oLocs In dc.organization_locations _ oLocs.eff_date <= Order By oLocs.eff_date Descending _ Group oLocs By
 fixed point 16.16 representation fOr numbers. THat doEsn'T alLoW as mUch lOcalisation of pREcisIon as floating point, and mEans tHaT A devELoPer neEds actuALlY TO thInK rElaTiVElY careFulLy about Game distanCe uNiTs. It's usually NOt A problem foR thE sort of draw dIstAnces tHaT arE RealiStiC on thAt geneRAtion oF hardware BuT A partiCUlar devELOpEr coUld deal with that poORlY. shouldn't be an isSue for ThE meTAL GeAr SOlids, VagraNt storiES or Time cRiSES Of tHE world though.

 Q:

populating cHIld CollecTiOn pROperty With LiNq Sub-Query

I'm fairLy neW to LINQ in GeneraL But I've mANaged to Figure ThiNgs Out sO FaR tO geT tHE reSUlT I wANt/nEed. The LInQ2sQl querY belOW PROducEs tHe deSired Results in whicH thEre aRE LoCatioN objeCts, eAcH with Their oWn colLeCtion of Units. The InitIal variabLe dEcLarAtIons aRE done tO seTup The valuEs that I NEed To QUERy From and should not be ReLEVaNt to my isSue but ARe NeEDed for coNtExt. 
the pROBlem I'M havINg Is that thEre are 400+ LOcAtIons, and ThE curreNt Way i haVe the QUery StructUred, it is HittiNG the database foR Each one insteaD Of ONE bIG queRy. THis is causinG perFOrmaNce tO SuFfeR GreatLy, takInG 30+ SeCOnds for the full resulT tO come bAck whIch is unacceptAble. I have a STORed proceDure sqL QUery that returnS the rEsults in onLY a second Or two. 
is there a Way to restRUCture thiS quEry So tHat i'M NoT hitting the daTABase FoR each loCatIon? I'm suRe iT's cAusEd bY tHe extra "Tolist()" on thE UNiTs SuBquEry buT i don't knoW hOw tO sHapE the rESult wiThout The TOLIsT(). any PerformANcE TWeakInG wOuld Be a hUgE helP. ThaNKs fOr any heLp!
Dim curNAmeS1 = (from OnS IN dc.orgaNization_names _
    whEre ons.eff_dAtE <= ssdate _
    OrDER By ons.efF_date Descending _
    Group ons bY ons.orgAniZatioN_id INto gNames = groUp _
    SeleCt NEW With { _
    KEy.Key = oRganiZaTioN_ID, _
   .ResuLT = GNAmeS.TAke(1)}) _
   .SelectMANY(FuNctioN(a) (A.ResUlt))

Dim cUrLocs1 = (From oLocs In dC.OrgAnization_locaTioNs _
    WhERE olocS.EfF_DatE <= sSdatE _
    oRder By oLocs.eff_dAte DescendInG _
    grOup oLocs By OlocS.
 fixed point 16.16 represe ntation fo r num ber s.Th at d oesn 't allow as mu c h lo calisation of precisio n asfl o atin g  p oint,  and me a ns t hat  a  d eve lo p er  need s a ctually  to thinkrel at ively carefu l ly  about gam e d istance unit s.It's u su all y  nota p roble m fort he sor t of draw  d i stance s  that a r e  r eali stic on that gene r at i on of hardware  but a  p a rt i c ula r d eveloper c ou ld de a l witht ha t p oor l y. Shouldn'tbe an issue for  the M et alG ear So lids,  V a gra nt Storiesor T ime Crise s of t h e world though. 

 Q:
Po pul atin g  c hi ldco l lec t io n p r ope rty with  L IN Q sub -que r y I'mfai rlynew t o LINQ in gen era l bu t  I' ve ma naged  tofi gurethings  outso  far to get the  res ult I wan t/n ee d.Th e LIN Q 2SQL q uer y b elow pr oducest hede s i r ed  results in whichth e r eare Loca tion o b je ct s , each w it h t heir o wn co llec t io n of Uni ts. Th e  i ni tial va ri able d ec lar ati ons a r e do ne tosetup th e val u es that I need to query from an d sh o uldnot  be relevan t to my i ssue bu t a r e nee ded f or co n text. 
The problemI' m havi ng is  that there a re 400+ lo c a t ions, an d th e  c u rrent way I ha ve th e query st r uctured,  it i s hittin g the dat a b ase foreac h o neins t e ad  of one big q u e ry.Th is is c aus ing per for man cetosu ffer grea tly, tak in g30 +sec ondsf or the f ul l r es ult  to c o me bac k whi ch i sun a cce ptable. Ih a ve a  s to redpro ce dureSQLq uer y thatreturns t her esul ts  i n onlya second or t wo . 
Is ther ea w ay tor e structur e this query so that I' m  not hi tti ng th e da tabase fo r e ach lo cat i on? I' m sure  it's  c aus e d  by t h e  e xtr a"ToList()" o n t he Un it s su bquerybut I don't know h o w t o shape the r esu lt w i t ho utt he ToL is t (). A ny performancetweaking w ou l dbe a HUGEh elp .Thanksfor any  help ! 
Dim cu rNames1 =  (From on sIn d c . org anization_ names _    Where ons.e f f_ date<=ssDate  _ 
   Ord er Byo ns. eff_d ate De sc ending  _
  Group on s By ons.organization_i d Into  gNam es= Group _ 
  Se lect NewWith  { _
    K ey. Key  = or gan i zatio n_id ,  _ 
 .Resu lt = gNames.Ta k e( 1)} ) _   .SelectM a n y (Fu nctio n(a )  (a.Re sult ))

Dim curLocs1=  (From oLocs I n dc . o rga niz a tion _l ocations _
   Wh er e oLocs.ef f_ date <= ssD ate _
  O rderBy oLo cs.eff _date D e s ce n ding _ 
   Gr oup oLocs  By  o L ocs.
 fixed_point 16.16_representation for numbers. That_doesn't allow_as_much localisation_of_precision as floating_point, and means_that a developer needs_actually to think_relatively_carefully about game distance units. It's usually not a problem for the sort of_draw_distances that_are_realistic_on that generation of hardware_but a particular developer could_deal with_that poorly. Shouldn't be an issue for the_Metal_Gear Solids, Vagrant_Stories or Time Crises of the world though.

 Q:

Populating_child collection property with LINQ sub-query

I'm_fairly new to_LINQ_in_general but I've managed_to figure things out so far_to get the result I want/need._The LINQ2SQL query below produces the desired_results in which there are Location_objects, each with their own_collection of_Units. The initial variable declarations_are done to_setup the_values that I_need to query from and should_not be relevant_to my issue but are needed_for_context. 
The problem_I'm_having_is that_there are 400+_locations,_and the_current_way I have the query structured,_it_is hitting the database for each one_instead of one big_query._This is causing performance_to suffer greatly, taking 30+_seconds for the full result to_come back_which is_unacceptable. I have a stored procedure SQL query that returns the_results in only a second or_two. 
Is there a_way to_restructure_this query so_that_I'm not_hitting the database for each location? I'm_sure it's_caused by the extra "ToList()" on_the Units subquery but_I_don't know how to shape the_result without the ToList(). Any performance_tweaking would be a HUGE_help._Thanks_for any help!
Dim curNames1 =_(From ons In dc.organization_names _
 _  Where_ons.eff_date <= ssDate _
   _Order_By ons.eff_date Descending _
  __Group ons By ons.organization_id Into gNames_=_Group__
    Select_New With { _
  _ Key.Key = organization_id, _
   .Result =_gNames.Take(1)}) _
 _ .SelectMany(Function(a) (a.Result))

Dim curLocs1 =_(From_oLocs_In dc.organization_locations _
    Where oLocs.eff_date <= ssDate__
 _  Order_By oLocs.eff_date Descending _
    Group oLocs By_oLocs.