Example #1
0
        private UnitOfWork CreateUnitOfWork()
        {
            DesignTimeDbContextFactory designTimeDbContextFactory = new DesignTimeDbContextFactory();

            context = designTimeDbContextFactory.CreateDbContext(new string[] { });
            return(new UnitOfWork(context));
        }
Example #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)
        {
            DesignTimeDbContextFactory designTimeDbContextFactory = new DesignTimeDbContextFactory();
            HangoutsContext            context = designTimeDbContextFactory.CreateDbContext(new String[] { });

            DbInitializer.Initialize(context);

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }


            app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod());
            app.UseMvc();
        }
Example #3
0
        static void Main(string[] args)
        {
            DesignTimeDbContextFactory designTimeDbContextFactory = new DesignTimeDbContextFactory();
            HangoutsContext            context = designTimeDbContextFactory.CreateDbContext(args);

            using (var db = context)
            {
                DbInitializer.Initialize(db);
                UnitOfWork unitOfWork = new UnitOfWork(context);
                ConsoleUI  console    = new ConsoleUI(unitOfWork);

                console.start();

                Console.ReadLine();
            }
        }
Example #4
0
 public AbstractRepository(HangoutsContext context)
 {
     this.context = context;
     dbSet        = context.Set <E>();
 }
Example #5
0
 public UnitOfWork(HangoutsContext context)
 {
     this.context = context;
 }