public void TearDown() { using (var context = new InsuranceAppContext()) { if (context.Database.Exists()) { context.Database.Delete(); } } }
public void TearDown() { using (var context = new InsuranceAppContext()) { if (context.Database.Exists()) { context.Database.Delete(); } } }
public void SetUp() { using (var context = new InsuranceAppContext()) { if (context.Database.Exists()) { context.Database.Delete(); } context.Database.Create(); } }
public void SetUp() { using (var context = new InsuranceAppContext()) { if (context.Database.Exists()) { context.Database.Delete(); } context.Database.Create(); } }
public static InsuranceAppContext GetDataContext() { var dataContextStorageContainer = DataContextStorageFactory<InsuranceAppContext>.CreateStorageContainer(); var insuranceAppContext = dataContextStorageContainer.GetDataContext(); if (insuranceAppContext == null) { insuranceAppContext = new InsuranceAppContext(); dataContextStorageContainer.Store(insuranceAppContext); } return insuranceAppContext; }
public RegisterModel( UserManager <IdentityUser> userManager, SignInManager <IdentityUser> signInManager, ILogger <RegisterModel> logger, IEmailSender emailSender, InsuranceAppContext context) { _userManager = userManager; _signInManager = signInManager; _logger = logger; _emailSender = emailSender; _context = context; }
public static InsuranceAppContext GetDataContext() { var dataContextStorageContainer = DataContextStorageFactory <InsuranceAppContext> .CreateStorageContainer(); var insuranceAppContext = dataContextStorageContainer.GetDataContext(); if (insuranceAppContext == null) { insuranceAppContext = new InsuranceAppContext(); dataContextStorageContainer.Store(insuranceAppContext); } return(insuranceAppContext); }
public static void Init(bool dropDatabaseIfModelChanges) { if (dropDatabaseIfModelChanges) { System.Data.Entity.Database.SetInitializer(new MyDropCreateDatabaseIfModelChanges()); using (var db = new InsuranceAppContext()) { db.Database.Initialize(false); } } else { System.Data.Entity.Database.SetInitializer <InsuranceAppContext>(null); } }
public static void Init(bool dropDatabaseIfModelChanges) { if (dropDatabaseIfModelChanges) { System.Data.Entity.Database.SetInitializer(new MyDropCreateDatabaseIfModelChanges()); using (var db = new InsuranceAppContext()) { db.Database.Initialize(false); } } else { System.Data.Entity.Database.SetInitializer<InsuranceAppContext>(null); } }
public void CanAddInsureeUsingInsuranceAppContext() { var insuree = new Insuree { DateOfBirth = DateTime.Now, DateCreated = DateTime.Now, FirstName = "TestFirstName", LastName = "TestLastName", DateModified = DateTime.Now }; var context = new InsuranceAppContext(); context.Insurees.Add(insuree); context.SaveChanges(); insuree.Id.Should().BeGreaterThan(0); }
public void CanAddInsureeUsingInsuranceAppContext() { var insuree = new Insuree { DateOfBirth = DateTime.Now, DateCreated = DateTime.Now, FirstName = "TestFirstName", LastName = "TestLastName", DateModified = DateTime.Now }; var context = new InsuranceAppContext(); context.Insurees.Add(insuree); context.SaveChanges(); insuree.Id.Should().BeGreaterThan(0); }
public void CanExecuteQueryAgainstDataContext() { var lastName = Guid.NewGuid().ToString(); var context = new InsuranceAppContext(); var insuree = new Insuree { DateOfBirth = DateTime.Now, DateCreated = DateTime.Now, FirstName = "TestFirstName", LastName = lastName, DateModified = DateTime.Now }; context.Insurees.Add(insuree); context.SaveChanges(); var insureeCheck = context.Insurees.Single(x => x.LastName == lastName); insureeCheck.Should().NotBeNull(); }
public void CanExecuteQueryAgainstDataContext() { var lastName = Guid.NewGuid().ToString(); var context = new InsuranceAppContext(); var insuree = new Insuree { DateOfBirth = DateTime.Now, DateCreated = DateTime.Now, FirstName = "TestFirstName", LastName = lastName, DateModified = DateTime.Now }; context.Insurees.Add(insuree); context.SaveChanges(); var insureeCheck = context.Insurees.Single(x => x.LastName == lastName); insureeCheck.Should().NotBeNull(); }
public PolicyHoldersController(InsuranceAppContext context, UserManager <IdentityUser> userManager) { _context = context; _userManager = userManager; }
public void CanCreateInsuranceAppContext() { var context = new InsuranceAppContext(); }
public void CanCreateInsuranceAppContext() { var context = new InsuranceAppContext(); }
public ClaimReportsController(InsuranceAppContext context, UserManager <IdentityUser> userManager) { _context = context; _userManager = userManager; }