public UserRepository() { if (_dbcontext == null) { _dbcontext = new AzureDbContext(); Database.SetInitializer <AzureDbContext>(null); } }
public StudentEnrolledCoursesTests() { _services = new ServiceCollection(); _services.AddDbContext <AzureDbContext>(options => options.UseSqlServer("Server=tcp:srosy-weber.database.windows.net,1433;Initial Catalog=LMS;Persist Security Info=False;User ID=srosy;Password=GaviSpe64!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;")); _provider = _services.BuildServiceProvider(); _context = _provider.GetRequiredService(typeof(AzureDbContext)) as AzureDbContext; _db = new DbService(); }
public void AzureDbContextDiagram() { using (var myContext = new AzureDbContext()) { var path = DotNet.GetExecutingDirectory() + "..\\..\\.."; System.IO.File.WriteAllText(Path.Combine(path, "AzureDbContextDiagram.dgml"), myContext.AsDgml(), System.Text.Encoding.UTF8); } }
public AZObsController(AzureDbContext context) { _context = context; //create at least one item if (_context.AZObsItems.Count() == 0) { _context.AZObsItems.Add(new AZObsItem { Name = "Item1" }); _context.SaveChanges(); } }
public static void Initialize(IServiceProvider serviceProvider) { using (var context = new AzureDbContext( serviceProvider.GetRequiredService <DbContextOptions <AzureDbContext> >())) { if (context.EmployeeDetail.Any()) { return; } context.EmployeeDetail.AddRange( new EmployeeDetail { Name = "Sorav Thakur", EmailAddress = "*****@*****.**" }, new EmployeeDetail { Name = "Demo", EmailAddress = "*****@*****.**" } ); context.SaveChanges(); } }
public UsersController(AzureDbContext context) { _context = context; }
public PeopleController(AzureDbContext db) { this.db = db; }
public PeopleController(AzureDbContext azureDbContext) { _azureDbContext = azureDbContext; }
public EmployeeDetailsController(AzureDbContext context) { _context = context; }
public AzureDbRepository(AzureDbContext context, IAzureUnitOfWork uow) { Context = context; Uow = uow; DbSet = context.Set <T>(); }
public AzureUnitOfWork(AzureDbContext context) { _context = context; InitRepositories(); }
public UserManagerService(AzureDbContext context) { _context = context; }
public DashboardService(AzureDbContext context) { _context = context; }
public PeopleController(ILogger <PeopleController> logger, AzureDbContext azureDbContext) { _logger = logger; this.azureDbContext = azureDbContext; }
public Repository(AzureDbContext context) { _context = context; }
public PeopleController(AzureDbContext context) { _context = context; }
public PeopleController(AzureDbContext _context) { context = _context; }