Ejemplo n.º 1
0
        // 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?}");
            });
        }
Ejemplo n.º 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μ);
            }
        }
Ejemplo n.º 3
0
 public MensagemController(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public ComentariosController(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public HomeController(blogContext eblogContext)
 {
     db = eblogContext;
 }
Ejemplo n.º 6
0
 public LogService(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 7
0
 public EfUserRepository(blogContext context) : base(context)
 {
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 11
0
 public EfCategoryRepository(blogContext context) : base(context)
 {
 }
Ejemplo n.º 12
0
 public EmailSender(blogContext context, EmailService EmailService, GlobalSettingService globalSettingService)
 {
     _context              = context;
     _EmailService         = EmailService;
     _globalSettingService = globalSettingService;
 }
 public BlogController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Ejemplo n.º 14
0
 public ContactController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Constructor'da Db erişimi sağlayan contexti getirir.
 /// </summary>
 /// <param name="context"></param>
 public ArticleRepository(blogContext context)
 {
     this.context = context;
 }
Ejemplo n.º 16
0
 public UserService(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 17
0
 public ManageController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Ejemplo n.º 18
0
 public BlogService(blogContext context, UserManager <User> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
Ejemplo n.º 19
0
 public RegistryController(ILogger <RegistryController> logger, blogContext context)
 {
     _logger  = logger;
     _context = context;
 }
Ejemplo n.º 20
0
 public LoginController(ILogger <LoginController> logger, blogContext context)
 {
     _logger  = logger;
     _context = context;
 }
Ejemplo n.º 21
0
 public GlobalSettingService(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 22
0
 public EfNewsRepository(blogContext context) : base(context)
 {
 }
 public HomeController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Ejemplo n.º 24
0
 public UserController(blogContext blogContext)
 {
     _blogContext = blogContext;
 }
Ejemplo n.º 25
0
 public CategoryService(blogContext context)
 {
     _context = context;
 }
Ejemplo n.º 26
0
 public CategoriaController(blogContext context)
 {
     _context = context;
 }