Esempio n. 1
0
 public AccountController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IEmailSender emailSender,
     ISmsSender smsSender,
     SensingSiteDbContext applicationDbContext,
     IUserService service)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _emailSender = emailSender;
     _smsSender = smsSender;
     _applicationDbContext = applicationDbContext;
     //this for testing.
     _userService = service;
 }
Esempio n. 2
0
 public SensingSiteDbContext Get()
 {
     return dataContext ?? (dataContext = new SensingSiteDbContext());
 }
Esempio n. 3
0
 public DatabaseFactory(SensingSiteDbContext dbContext)
 {
     dataContext = dbContext;
 }
Esempio n. 4
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(SensingSiteDbContext context)
 {
     if (!_databaseChecked)
     {
         _databaseChecked = true;
         context.Database.Migrate();
     }
 }