Exemplo n.º 1
0
        // 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();
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public Repository(DataCtx context)
 {
     //var db = new DataCtx();
     _context = context;
 }
Exemplo n.º 5
0
 public UserController(DataCtx dataContx, IJwtAuthenticationManager ajwtAuthenticationManage)
 {
     this.dataContx = dataContx;
     this.jwtAuthenticationManager = ajwtAuthenticationManage;
 }
Exemplo n.º 6
0
 public SDK()
 {
     Worker       = new Worker(context: DataCtx.Create());
     UsersManager = new UsersManager(Worker);
     PostsManager = new PostsManager(Worker);
 }