Example #1
0
 public UnitOfWork(ReportDBContext context)
 {
     _context         = context;
     Associates       = new AssociateRepository(_context);
     Events           = new EventRepository(_context);
     Enrollments      = new EnrollmentRepository(_context);
     ApplicationUsers = new UserRepository(_context);
     PointOfContacts  = new PocRepository(_context);
     File             = new FileRepository(_context);
     ReportFilter     = new ReportFilterRepository(_context);
 }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            //  DbContextOptions dbo = new DbContextOptions();
            //    dbo.UseSqlServer(Configuration.GetConnectionString("EsiConnectionString"));

            //    ReportDBContext rbd = new ReportDBContext(dbo);

            services.AddDbContext <ReportDBContext>(options => options.UseSqlServer(Configuration.GetConnectionString("EsiConnectionString")));

            //services.addte<EsiEventManager>();
            services.AddSingleton <RabbitConnect>(sp =>
            {
                var logger = sp.GetRequiredService <ILogger <RabbitConnect> >();

                var factory = new ConnectionFactory()
                {
                    HostName = Configuration["EsiIp"]
                };

                if (!string.IsNullOrEmpty(Configuration["EsiEventUserName"]))
                {
                    factory.UserName = Configuration["EsiEventUserName"];
                }

                if (!string.IsNullOrEmpty(Configuration["EsiEventPassword"]))
                {
                    factory.Password = Configuration["EsiEventPassword"];
                }
                // sp.EsiEventReceived += EsiEventManager.MyEventBut_EsiEventReceived;

                var myEE = new RabbitConnect(factory, Configuration["EsiExname"], Configuration["EsiQname"]);
                //          var myem = new EsiEventManager(DbContextOptions< ReportDBContext>(options =>
                //options.UseSqlServer(Configuration.GetConnectionString("EsiConnectionString")));
                DbContextOptionsBuilder <ReportDBContext> yy = new DbContextOptionsBuilder <ReportDBContext>();
                var tt                 = yy.UseSqlServer(Configuration.GetConnectionString("EsiConnectionString"));
                ReportDBContext db     = new ReportDBContext(tt.Options);
                var dd                 = new EsiEventManager(db);
                myEE.EsiEventReceived += dd.MyEventBut_EsiEventReceived;
                return(myEE);
            });
            services.AddOptions();
        }
 public AuthRepository(ReportDBContext context) : base(context)
 {
 }
Example #4
0
 public ReportRepository(ReportDBContext context) : base(context)
 {
     dbcontext = context;
 }
 public EnrollmentRepository(ReportDBContext context) : base(context)
 {
 }
Example #6
0
 public PocRepository(ReportDBContext context) : base(context)
 {
 }
Example #7
0
 public ReportRepository(ReportDBContext reportDBContext)
 {
     _reportDBContext = reportDBContext;
 }
Example #8
0
 public CommentRepository(ReportDBContext context) : base(context)
 {
     this.context = context;
 }
 public ReportController(ReportDBContext mydb)
 {
     db = mydb;
     // _rabbitConnect = rabbitConnect;
 }
 public AssociateRepository(ReportDBContext context) : base(context)
 {
 }
 public EsiEventManager(ReportDBContext reportDBContext)
 {
     _reportDBContext = reportDBContext;
 }
Example #12
0
 public ScoresRepository(ReportDBContext context) : base(context)
 {
     this.context = context;
 }
Example #13
0
 public FileRepository(ReportDBContext context) : base(context)
 {
 }
 public ReportFilterRepository(ReportDBContext context) : base(context)
 {
 }
Example #15
0
 public static void Initialize(ReportDBContext context)
 {
     context.Database.EnsureCreated();
 }
Example #16
0
 public IntensityCheckRepository(ReportDBContext context) : base(context)
 {
 }
Example #17
0
 public UserRepository(ReportDBContext context) : base(context)
 {
 }
Example #18
0
 public ModuleRepository(ReportDBContext context) : base(context)
 {
     this.context = context;
 }