private void FinalizeRegistration(RegisterModel model) { using (DoctorsContext context = new DoctorsContext()) { var doctor = context.DoctorProfiles.First(x => x.Email == model.Email); doctor.Name = model.Name; doctor.LastName = model.LastName; doctor.SecondName = model.SecondName; doctor.PhoneNumber = model.PhoneNumber; doctor.Organisation = model.Organisation; doctor.Position = model.Position; context.SaveChanges(); } }
public SimpleMembershipInitializer() { Database.SetInitializer <DoctorsContext>(null); try { using (var context = new DoctorsContext()) { if (!context.Database.Exists()) { // Создание базы данных SimpleMembership без схемы миграции Entity Framework ((IObjectContextAdapter)context).ObjectContext.CreateDatabase(); } } WebSecurity.InitializeDatabaseConnection("DefaultConnection", "DoctorProfile", "DoctorId", "Email", autoCreateTables: true); } catch (Exception ex) { throw new InvalidOperationException("Не удалось инициализировать базу данных ASP.NET Simple Membership. Чтобы получить дополнительные сведения, перейдите по адресу: http://go.microsoft.com/fwlink/?LinkId=256588", ex); } }
public DoctorsController(DoctorsContext context) { _context = context; }
public DoctorsController(DoctorsContext doctorsContext) { _doctorsContext = doctorsContext; }