<commit_before>﻿using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NoteFolder.Models {
	public class FileDbContext : DbContext {
		public DbSet<File> Files { get; set; }
	}

	public class File {
		public int ID { get; set; }
		public string Name { get; set; }
		public string Description { get; set; }
		public string Text { get; set; }
		public bool IsFolder { get; set; }
		public DateTime TimeCreated {get; set; }<commit_msg>Add test data seeder to DbContext.<commit_after>﻿using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NoteFolder.Models {
	public class FileTestInit : DropCreateDatabaseAlways<FileDbContext> {
		protected override void Seed(FileDbContext db) {
			var docs = new File { Name = "Documents", Description = "", IsFolder = true };
			var proj = new File { Name = "Projects", Description = "", IsFolder = true };
			var nf = new File { Name = "NoteFolder", Description = "Note organization", IsFolder = true };
			var sln = new File { Name = "NoteFolder.sln", Description = "", IsFolder = false, Text = "<Solution text>" };
			var source = new File { Name = "Source", Description = "", IsFolder = true };
			var cs = new File { Name = "NoteFolder.cs", Description = "", IsFolder = false, Text = "<Source code>" };
			proj.SetParent(docs);
			nf.SetParent(proj);
			sln.SetParent(nf);
			source.SetParent(nf);
			cs.SetParent(source);
			db.Files.AddRange(new File[] {docs, proj, nf, sln, source, cs });
			base.Seed(db);
		}
	}
	public static class FileDebugExtensions {
		public static void SetParent(this File f, File parent) {
			f.Parent = parent;
			parent.Children.Add(f);
		}
	}
	public class FileDbContext : DbContext {
		public DbSet<File> Files { get; set; }
		public FileDbContext() {
			Database.SetInitializer(new FileTestInit());
		}
	}

	public class File {
		public int ID { get; set; }
		public string Name { get; set; }
		public string Description { get; set; }
		public string Text { get; set; }
		public bool IsFolder { get; set; }
		public DateTime TimeCreated {get; set; }
{'fraction_non_alphanumeric': 0.12384044526901669, 'fraction_numerical': 0.0, 'mean_word_length': 3.9134396355353074, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780940', 'n_tokens_mistral': 724, 'n_tokens_neox': 659, 'n_words': 217}