public void Serialize(AssemblyBase assemblyBase) { Database.SetInitializer(new CreateDatabaseIfNotExists <DbSaverContext>()); AssemblyDbSaver assembly = new AssemblyDbSaver(assemblyBase); using (var context = new DbSaverContext()) { context.AssemblyDbSavers.Add(assembly); context.SaveChanges(); SystemSounds.Beep.Play(); } }
public AssemblyBase Deserialize() { AssemblyBase assembly = new AssemblyBase(); using (var context = new DbSaverContext()) { context.AssemblyDbSavers.Load(); context.NamespaceDbSavers.Load(); context.TypeDbSavers.Load(); context.MethodDbSavers.Load(); context.PropertyDbSavers.Load(); context.ParameterDbSavers.Load(); assembly = DataTransferGraphMapper.AssemblyBase(context.AssemblyDbSavers.First()); } return(assembly); }