Beispiel #1
0
 public HomeController(
     ApplicationDbContext applicationDbContext,
     PrestamoContext prestamoContext)
 {
     _applicationDbContext = applicationDbContext;
     _prestamoContext      = prestamoContext;
 }
Beispiel #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();
     }
 }
        public PrestamoController(PrestamoContext context)
        {
            _context = context;

            if (_context.PrestamoItems.Count() == 0)
            {
                _context.SaveChanges();
            }
        }
 public PrestamoController(PrestamoContext prestamoContext, IMapper mapperConfig)
 {
     db     = prestamoContext;
     mapper = mapperConfig;
 }
 public BuscarClienteViewComponent(PrestamoContext context, IMapper mapperConfig)
 {
     db     = context;
     mapper = mapperConfig;
 }