public void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (_context == null)
     {
         return;
     }
     _context.Dispose();
     _context = null;
 }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, UserDataDbContext dbContext)
        {
#if RELEASE
            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders =
                    Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedFor |
                    Microsoft.AspNetCore.HttpOverrides.ForwardedHeaders.XForwardedProto
            });
#endif
            var address = Environment.GetEnvironmentVariable(EnvironmentVariables.BlockChainAddress);
            app.UseCors(builder => builder.WithOrigins("*") //address
                        .AllowAnyHeader()
                        .AllowAnyMethod()
                        .AllowAnyOrigin()
                        );


            app.UseMiddleware <ErrorHandlingMiddleware>();

            InitDb(dbContext);

            app.UseMvc();
        }
 public UserRepository(UserDataDbContext context) : base(context)
 {
     _context = context;
 }
 public GenericRepository(UserDataDbContext context)
 {
     _context = context;
     DbSet = _context.Set<T>();
 }
Beispiel #5
0
 public UserDataController(UserDataDbContext context)
 {
     _context = context;
 }
 public UnitOfWork(UserDataDbContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Beispiel #7
0
        private async void InitDb(UserDataDbContext dbContext)
        {
            await dbContext.Database.EnsureCreatedAsync();

            //await dbContext.Database.MigrateAsync();
        }
Beispiel #8
0
 public RoleService(UserDataDbContext context)
 {
     _store = new RoleStore <IdentityRole>(context);
 }