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 :
played wizard , created valid edmx
files.
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 :
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:
actually default name entity container of conceptual entity model. if open edmx file in designer , take on properties, see:
if change name, context re-generated name have provided.
Comments
Post a Comment