// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider)
        {
            blogContext blogContext = serviceProvider.GetService <blogContext>();

            Program.Site = blogContext.Sites.Single();
            app.UseSession();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Example #2
0
        public static void Main()
        {
            using (var db = new blogContext())
            {
                Console.WriteLine("Starting...");
                var stopWatch = new Stopwatch();
                stopWatch.Start();
                var expression =
                    from b in db.Blog
                    join p in db.Post on b.BlogId equals p.BlogId
                    select new { b.Url, p.Title, p.Content };

                long interpret = stopWatch.ElapsedTicks;
                var  items     = expression.ToList();
                long read      = stopWatch.ElapsedTicks;
                var  filtered  = items.Where(i => i.Url == "768aea71-c405-4808-b1e6-150692142875").ToList();
                long scan      = stopWatch.ElapsedTicks;
                var  firstable = filtered.First();
                long first     = stopWatch.ElapsedTicks;
                var  five      = filtered[5];
                stopWatch.Stop();

                foreach (var item in filtered.Take(9))
                {
                    Console.WriteLine("1:{0}", item.Url);
                    Console.WriteLine("2:{0}", item.Title);
                    Console.WriteLine("3:{0}", item.Content);
                }

                const double kμ = 0.001;
                Console.WriteLine();
                Console.WriteLine("Read {0} records in {1:N0} μs", items.Count(), (read - interpret) * kμ);
                Console.WriteLine("Assigned expression in {0:N0} μs", interpret * kμ);
                Console.WriteLine("Scan in {0:N0} μs", (scan - read) * kμ);
                Console.WriteLine("Enumerate next in {0:N0} μs", (first - scan) * kμ);
                Console.WriteLine("Index 5 in {0:N2} μs", (stopWatch.ElapsedTicks - first) * kμ);
                Console.WriteLine("Total time was {0:N0} μs", stopWatch.ElapsedTicks * kμ);
            }
        }
Example #3
0
 public MensagemController(blogContext context)
 {
     _context = context;
 }
Example #4
0
 public ComentariosController(blogContext context)
 {
     _context = context;
 }
Example #5
0
 public HomeController(blogContext eblogContext)
 {
     db = eblogContext;
 }
Example #6
0
 public LogService(blogContext context)
 {
     _context = context;
 }
 public EfUserRepository(blogContext context) : base(context)
 {
 }
Example #8
0
 public EmailService(blogContext context, GlobalSettingService globalSettingService)
 {
     _context = context;
     _globalSettingService = globalSettingService;
 }
 public PostDataService(blogContext dataContext, ILogger logger)
 {
     _dataContext = dataContext;
     _logger      = logger;
 }
 public ModuleController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Example #11
0
 public EfCategoryRepository(blogContext context) : base(context)
 {
 }
Example #12
0
 public EmailSender(blogContext context, EmailService EmailService, GlobalSettingService globalSettingService)
 {
     _context              = context;
     _EmailService         = EmailService;
     _globalSettingService = globalSettingService;
 }
 public BlogController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Example #14
0
 public ContactController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
 /// <summary>
 /// Constructor'da Db erişimi sağlayan contexti getirir.
 /// </summary>
 /// <param name="context"></param>
 public ArticleRepository(blogContext context)
 {
     this.context = context;
 }
Example #16
0
 public UserService(blogContext context)
 {
     _context = context;
 }
Example #17
0
 public ManageController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Example #18
0
 public BlogService(blogContext context, UserManager <User> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
Example #19
0
 public RegistryController(ILogger <RegistryController> logger, blogContext context)
 {
     _logger  = logger;
     _context = context;
 }
Example #20
0
 public LoginController(ILogger <LoginController> logger, blogContext context)
 {
     _logger  = logger;
     _context = context;
 }
 public GlobalSettingService(blogContext context)
 {
     _context = context;
 }
Example #22
0
 public EfNewsRepository(blogContext context) : base(context)
 {
 }
 public HomeController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Example #24
0
 public UserController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Example #25
0
 public CategoryService(blogContext context)
 {
     _context = context;
 }
Example #26
0
 public CategoriaController(blogContext context)
 {
     _context = context;
 }