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); }
// 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) { }
public ReportRepository(ReportDBContext context) : base(context) { dbcontext = context; }
public EnrollmentRepository(ReportDBContext context) : base(context) { }
public PocRepository(ReportDBContext context) : base(context) { }
public ReportRepository(ReportDBContext reportDBContext) { _reportDBContext = reportDBContext; }
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; }
public ScoresRepository(ReportDBContext context) : base(context) { this.context = context; }
public FileRepository(ReportDBContext context) : base(context) { }
public ReportFilterRepository(ReportDBContext context) : base(context) { }
public static void Initialize(ReportDBContext context) { context.Database.EnsureCreated(); }
public IntensityCheckRepository(ReportDBContext context) : base(context) { }
public UserRepository(ReportDBContext context) : base(context) { }
public ModuleRepository(ReportDBContext context) : base(context) { this.context = context; }