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