示例#1
0
        public void Dispose()
        {
            try
            {
                if (Context == null)
                {
                    return;
                }

                Context.SaveChanges();
                Context.Dispose();
            }
            catch (ObjectDisposedException)
            {
            }
            finally
            {
                Context = null;
            }
        }
示例#2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, DakiAccDbContext accDbContext,
                              DakiDbContext dakiDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseAuthentication();
            app.UseHttpsRedirection();
            app.UseMvc(routes => { routes.MapRoute("default", "{controller}/{action}/{id?}"); });
            app.UseCors();

            //
            accDbContext.Database.EnsureCreated();
            dakiDbContext.Database.EnsureCreated();
        }
示例#3
0
 public HuntService(DakiDbContext dbContext) : base(dbContext)
 {
 }
示例#4
0
 public ServiceBase(DakiDbContext dbContext)
 {
     Context = dbContext;
 }
示例#5
0
 public UserPropertiesService(DakiDbContext dbContext) : base(dbContext)
 {
 }
示例#6
0
 public UserService(DakiDbContext dbContext) : base(dbContext)
 {
 }