private async void AddMoleculeCommandAsync() { if (ValidateMolecule()) { try { string tmp = await _dbService.AddMolecule(_Molecule); OutputMessages.Add(new OutputMessage() { Message = tmp, Level = "debug" }); _logService.Write(this, tmp, "debug"); } catch (Exception e) { OutputMessages.Add(new OutputMessage() { Message = "Molecule cannot save to database, read the log file for more info!", Level = "fatal" }); _logService.Write(this, e.InnerException.InnerException.Message, "fatal"); } } }