Ejemplo n.º 1
0
 public void Save(BaseAssemblyModel _object, string path)
 {
     ClearDB();
     using (TPADBContext context = new TPADBContext())
     {
         DBAssemblyModel assemblyModel = (DBAssemblyModel)_object;
         context.AssemblyModel.Add(assemblyModel);
         context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 private void ClearDB()
 {
     using (TPADBContext context = new TPADBContext())
     {
         context.Database.ExecuteSqlCommand("DELETE FROM ParameterModel WHERE ID != -1");
         context.Database.ExecuteSqlCommand("DELETE FROM PropertyModel WHERE ID != -1");
         context.Database.ExecuteSqlCommand("DELETE FROM MethodModel WHERE ID != -1");
         context.Database.ExecuteSqlCommand("DELETE FROM TypeModel ");
         context.Database.ExecuteSqlCommand("DELETE FROM NamespaceModel WHERE ID != -1");
         context.Database.ExecuteSqlCommand("DELETE FROM AssemblyModel WHERE ID != -1");
         context.SaveChanges();
     }
 }