Kuv yuav ua li cas thiaj tsim tau ib hom complex hauv Entity Framework?
Kuv yuav ua li cas thiaj tsim tau ib hom complex hauv Entity Framework?

Video: Kuv yuav ua li cas thiaj tsim tau ib hom complex hauv Entity Framework?

Video: Kuv yuav ua li cas thiaj tsim tau ib hom complex hauv Entity Framework?
Video: Ntshe yog kuv tsis txawj hlub koj. 10/5/2017 2024, Tej zaum
Anonim

Right-click ib qhov chaw , taw tes rau Ntxiv Tshiab, thiab xaiv nyuaj Khoom. A hom complex cov cuab yeej nrog lub npe default yog ntxiv rau qhov chaw . Lub neej ntawd hom (xaiv los ntawm cov uas twb muaj lawm hom complex ) yog muab rau cov cuab yeej. Muab qhov xav tau hom mus rau cov khoom nyob rau hauv lub qhov rais Properties.

Tsis tas li ntawd, dab tsi yog hom complex hauv Entity Framework?

lus-api. cov ntaub ntawv-annotations. Cov Hom complex yog cov khoom tsis-scalar ntawm yam hom uas ua kom cov khoom scalar tau teeb tsa hauv cov chaw . Hom complex tsis muaj cov yuam sij thiab yog li tsis tuaj yeem nyob ntawm nws tus kheej. Nws tuaj yeem tsuas muaj nyob raws li cov khoom ntawm yam hom los yog lwm yam hom complex.

Kuv yuav ntxiv cov txheej txheem khaws cia rau hauv cov ntaub ntawv.edmx li cas? Teb

  1. Txoj nyem rau ntawm qhov chaw lossis qhov chaw khoob hauv qhov rais tsim.
  2. Xaiv Ntxiv>> Muaj nuj nqi Import…
  3. Ntaus lub Function Ntshuam Lub Npe raws li koj nyiam, xaiv lub npe Cov txheej txheem khaws cia hauv cov npe teev tseg, thiab teeb tsa hom rov qab los ntawm txoj haujlwm no.
  4. Ces koj hu rau txoj kev zoo li no: context.myStoredProcedure();

Ua kom pom qhov no, Scalar cov cuab yeej hauv Entity Framework yog dab tsi?

Scalar khoom yog khoom uas muaj nuj nqis tiag muaj nyob rau hauv qhov chaw . A vaj tse ntawm ib qhov chaw uas maps rau ib qho chaw hauv cov qauv cia. E.g. Tub kawm qhov chaw muaj scalar zog e.g. StudentId, StudentName. Cov no suav nrog Cov Tub Kawm Ntawv cov kab lus.

Muaj pes tsawg hom complex muaj?

Nws txhais tau tias ob hom ntawm cov zauv, tiag thiab kev xav, ua ke ua ib complex , ib yam li lub tsev complex (cov tsev koom ua ke).

Pom zoo: