// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); app.UseSwagger(); app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); app.UseMvc(); using (var s = app.ApplicationServices.CreateScope()) { var context = new DataCtx(s.ServiceProvider.GetRequiredService <DbContextOptions <DataCtx> >()); context.Database.EnsureCreated(); } }
public Worker(DataCtx context) { _context = context; Comments = new Repository <Comment>(_context); Likes = new Repository <Like>(_context); Posts = new Repository <Post>(_context); Users = new Repository <User>(_context); }
public Worker(DataCtx context) { _context = context; //Accounts = new Repository<Account>(_context); InternalTransactions = new Repository <InternalTransaction>(_context); Transactions = new Repository <Transaction>(_context); Users = new Repository <User>(_context); BalanceSheet = new Repository <BalanceSheet>(_context); SedcAccounts = new Repository <SedcAccount>(_context); SEDCTransaction = new Repository <SEDCTransaction>(_context); }
public Repository(DataCtx context) { //var db = new DataCtx(); _context = context; }
public UserController(DataCtx dataContx, IJwtAuthenticationManager ajwtAuthenticationManage) { this.dataContx = dataContx; this.jwtAuthenticationManager = ajwtAuthenticationManage; }
public SDK() { Worker = new Worker(context: DataCtx.Create()); UsersManager = new UsersManager(Worker); PostsManager = new PostsManager(Worker); }