is possible set custom namespace default place ef model types generated bd , set default reference ( using mycustomenamespace
) @ dbcontext class?
namespace ef.models { using system; using system.data.entity; using system.data.entity.infrastructure; using system.data.entity.core.objects; using system.linq; using mycustomenamespace; public partial class test_entities : dbcontext { public carepgd_produkcja_entities() : base("name=test_entities") { } public virtual dbset<myclass> myclass{ get; set; } } }
and in other project
//in other projekt in same solution added refences namespace mycustomenamespace { public partial myclass { //code } }
in current moment after 'update bd' must db types mycustomenamespace
, delete ef.models , add using mycustomenamespace
dbcontext
.
ef ver 6.1.3 .tt part of .edx
solution structure
- mvc
- webapi ( here ef model.edmx)
- classlibrary (here i'm coping models.cs webapi\model.tt)
mvc , webapi have reference classlibrary
Comments
Post a Comment