private void DoParseDirectoryContent(DirectoryContentThreadInfo info)
        {
            Log.Begin($"{nameof(DoParseDirectoryContent)}.{info.FullPath}");

            foreach (Content entity in _physicalFilesParser.ParsePhysicalFiles(info))
            {
                PersistContentEntity(entity);
            }

            Log.End($"{nameof(DoParseDirectoryContent)}.{info.FullPath}");
        }
예제 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
        {
            Log.Begin("Configure");
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            //loggerFactory.AddLog4Net();
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });
            Log.End("Configure");
        }
예제 #3
0
        public string ComputeFileContentHash(string path)
        {
            Log.Begin($"{nameof(ComputeFileContentHash)}", path);
            Stream stream = GetStream(path);

            var retVal = IsSupportedImage(path) ? ImageHash(stream) : OtherFileHash(stream);

            Log.End($"{nameof(ComputeFileContentHash)}", retVal);
            return(retVal);
        }
예제 #4
0
        public void DetachAllEntities()
        {
            Log.Begin(nameof(DetachAllEntities));

            var changedEntriesCopy = ChangeTracker.Entries()
                                     .Where(e => e.State == EntityState.Added ||
                                            e.State == EntityState.Modified ||
                                            e.State == EntityState.Deleted)
                                     .ToList();

            foreach (var entry in changedEntriesCopy)
            {
                entry.State = EntityState.Detached;
            }

            Log.End(nameof(DetachAllEntities));
        }