public void Save(DTGAssemblyMetadata assemblyModel, string path)
 {
     using (var context = new DatabaseModelContext(path))
     {
         context.Assemblies.Add(DatabaseAssemblyMapper.MapToDatabase(assemblyModel));
         context.SaveChanges();
     }
 }
Esempio n. 2
0
        public void AddMessage(DTGMessage dTGMessage)
        {
            DatabaseMessage databaseMessage = new DatabaseMessage
            {
                MessageString = dTGMessage.MessageString
            };

            using (var context = new DatabaseModelContext(ConfigurationManager.AppSettings["connectionstring"]))
            {
                context.Messages.Add(databaseMessage);
                context.SaveChanges();
            }
        }
 public DTGAssemblyMetadata Read(string path)
 {
     using (var context = new DatabaseModelContext(path))
     {
         context.Assemblies.Load();
         context.Namespaces.Load();
         context.Methods.Load();
         context.Parameters.Load();
         context.Properties.Load();
         context.Types.Load();
         var ret = context.Assemblies.First();
         return(DatabaseAssemblyMapper.MapToDTG(ret));
     }
 }