Entitfy Framework DbContext and xxxEntities? -


i have sql server db ( tables etc) , ive installed ef6 in order use async stuff ( p.s. im new ef).

so added :

enter image description here

played wizard , created valid edmx files.

enter image description here

my db name dump added dumpentities suffix :'

so can :

de = new dumpentities1();  var data=de.agegroups.tolist()  

but why don't have dbcontext ? see in many places ?

is xxxentityes replacement dbcontext ?

cause seems can actions xxentites ...

edit

ive searched "dbcontext" in solution , apprently have :

enter image description here

so going on here?

does using xxxentiyies new way ?( , not doing xxxcontext = new xxxcontext()...even if wanted - dont have it...)

you should not use dbcontext directly (that not make sense) in entity framework. instead use own custom context - class inherited dbcontext holds sets specific application. when use database first approach custom entity class generated based on edmx file data, in turn generated based on database schema.

regarding naming... not obvious custom context generated, have same name connection string name when creating edmx file:

enter image description here

actually default name entity container of conceptual entity model. if open edmx file in designer , take on properties, see:

enter image description here

if change name, context re-generated name have provided.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -