public UnitOfWork(bool lazyLoadingEnabled, bool proxyCreationEnabled) { string fullName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; context = ModelDb.Create(); if (fullName == "Win") { context = ModelDb.Create(DataSource.ConnectionString); } ; //(/*DataSource.ConnectionString ?? context.Database.Connection.ConnectionString*/); this.context.Configuration.LazyLoadingEnabled = lazyLoadingEnabled; this.context.Configuration.ProxyCreationEnabled = proxyCreationEnabled; }
public UnitOfWork() { string fullName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; context = ModelDb.Create(); if (fullName == "Win") { context = ModelDb.Create(DataSource.ConnectionString); } //(/*DataSource.ConnectionString ?? context.Database.Connection.ConnectionString*/); }
private async void BtnLogin_Click(object sender, EventArgs e) { UnitOfWork unitOfWork = new UnitOfWork(); unitOfWork = new UnitOfWork(); ApplicationUserManager userManager = new ApplicationUserManager(new UserStores(ModelDb.Create())); var user = await userManager.FindByNameAsync(txtUserName.Text); if (user == null) { MessageBox.Show("Invalid UserName", "Invalid UserName", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var res = userManager.PasswordHasher.VerifyHashedPassword(user.PasswordHash, txtPassword.Text); if (res != Microsoft.AspNet.Identity.PasswordVerificationResult.Success) { MessageBox.Show("Invalid Password", "Invalid Password", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (chkRemember.Checked) { Settings.Default.UserName = txtUserName.Text; Settings.Default.Password = txtPassword.Text; Settings.Default.RememberMe = chkRemember.Checked; Settings.Default.Save(); } else { Settings.Default.UserName = string.Empty; Settings.Default.Password = string.Empty; Settings.Default.RememberMe = false; Settings.Default.Save(); } User.UserId = user.Id; isClosed = true; this.Close(); }
public UnitOfWork() { context = ModelDb.Create(DataSource.ConnectionString);//(/*DataSource.ConnectionString ?? context.Database.Connection.ConnectionString*/); }
private ModelDb context;//= new ModelDb(); public UnitOfWork() { this.context = ModelDb.Create(DataSource); }
public UnitOfWork(bool lazyLoadingEnabled, bool proxyCreationEnabled) { context = ModelDb.Create(DataSource.ConnectionString);//(/*DataSource.ConnectionString ?? context.Database.Connection.ConnectionString*/); this.context.Configuration.LazyLoadingEnabled = lazyLoadingEnabled; this.context.Configuration.ProxyCreationEnabled = proxyCreationEnabled; }
public UnitOfWork(bool lazyLoadingEnabled, bool proxyCreationEnabled) { this.context.Configuration.LazyLoadingEnabled = lazyLoadingEnabled; this.context.Configuration.ProxyCreationEnabled = proxyCreationEnabled; this.context = ModelDb.Create(); }
public UnitOfWork() { this.context = ModelDb.Create(); }
public FrmLogin() { InitializeComponent(); this.userManager = new ApplicationUserManager(new UserStores(ModelDb.Create())); }