示例#1
0
 public HomeController(
     ApplicationDbContext applicationDbContext,
     PrestamoContext prestamoContext)
 {
     _applicationDbContext = applicationDbContext;
     _prestamoContext = prestamoContext;
 }
示例#2
0
 // The following code creates the database and schema if they don't exist.
 // This is a temporary workaround since deploying database through EF migrations is
 // not yet supported in this release.
 // Please see this http://go.microsoft.com/fwlink/?LinkID=615859 for more information on how to do deploy the database
 // when publishing your application.
 private static void EnsureDatabaseCreated(ApplicationDbContext _appcontext, PrestamoContext _prescontext)
 {
     if (!_databaseChecked)
     {
         _databaseChecked = true;
         _appcontext.Database.Migrate();
         _prescontext.Database.Migrate();
     }
 }
示例#3
0
 public ClienteController(PrestamoContext prestamoContext, IMapper mapperConfig)
 {
     db = prestamoContext;
     mapper = mapperConfig;
 }