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();
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
 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;
 }
Esempio n. 7
0
 public PeopleController(AzureDbContext db)
 {
     this.db = db;
 }
Esempio n. 8
0
 public PeopleController(AzureDbContext azureDbContext)
 {
     _azureDbContext = azureDbContext;
 }
 public EmployeeDetailsController(AzureDbContext context)
 {
     _context = context;
 }
Esempio n. 10
0
 public AzureDbRepository(AzureDbContext context, IAzureUnitOfWork uow)
 {
     Context = context;
     Uow     = uow;
     DbSet   = context.Set <T>();
 }
Esempio n. 11
0
 public AzureUnitOfWork(AzureDbContext context)
 {
     _context = context;
     InitRepositories();
 }
 public UserManagerService(AzureDbContext context)
 {
     _context = context;
 }
Esempio n. 13
0
 public DashboardService(AzureDbContext context)
 {
     _context = context;
 }
Esempio n. 14
0
 public PeopleController(ILogger <PeopleController> logger, AzureDbContext azureDbContext)
 {
     _logger             = logger;
     this.azureDbContext = azureDbContext;
 }
Esempio n. 15
0
 public Repository(AzureDbContext context)
 {
     _context = context;
 }
 public PeopleController(AzureDbContext context)
 {
     _context = context;
 }
Esempio n. 17
0
 public PeopleController(AzureDbContext _context)
 {
     context = _context;
 }