public void Save(DTGAssemblyMetadata assemblyModel, string path) { using (var context = new DatabaseModelContext(path)) { context.Assemblies.Add(DatabaseAssemblyMapper.MapToDatabase(assemblyModel)); context.SaveChanges(); } }
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(); } }