// 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?}"); }); }
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μ); } }
public MensagemController(blogContext context) { _context = context; }
public ComentariosController(blogContext context) { _context = context; }
public HomeController(blogContext eblogContext) { db = eblogContext; }
public LogService(blogContext context) { _context = context; }
public EfUserRepository(blogContext context) : base(context) { }
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; }
public EfCategoryRepository(blogContext context) : base(context) { }
public EmailSender(blogContext context, EmailService EmailService, GlobalSettingService globalSettingService) { _context = context; _EmailService = EmailService; _globalSettingService = globalSettingService; }
public BlogController(blogContext blogContext) { _blogContext = blogContext; }
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; }
public UserService(blogContext context) { _context = context; }
public ManageController(blogContext blogContext) { _blogContext = blogContext; }
public BlogService(blogContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
public RegistryController(ILogger <RegistryController> logger, blogContext context) { _logger = logger; _context = context; }
public LoginController(ILogger <LoginController> logger, blogContext context) { _logger = logger; _context = context; }
public GlobalSettingService(blogContext context) { _context = context; }
public EfNewsRepository(blogContext context) : base(context) { }
public HomeController(blogContext blogContext) { _blogContext = blogContext; }
public UserController(blogContext blogContext) { _blogContext = blogContext; }
public CategoryService(blogContext context) { _context = context; }
public CategoriaController(blogContext context) { _context = context; }