public void SaveLicenseMessage(AppLicenseMessageDTO model) { var trl = _dataService.GetEntity <TrlApplication>(p => p.Id == model.AppId).SingleOrDefault(); if (trl == null || string.IsNullOrEmpty(trl.ExpertiseResult) || trl.AppDecisionId == null) { return; } var licenseMsg = _dataService.GetEntity <AppLicenseMessage>(p => p.Id == model.Id).SingleOrDefault(); if (licenseMsg != null) { return; } licenseMsg = new AppLicenseMessage(); _objectMapper.Map(model, licenseMsg); licenseMsg.Performer = model.PerformerId; licenseMsg.OldLimsId = _limsExchangeService.ExportLimsMessageTRL(licenseMsg).Result; licenseMsg.State = "Підготовка"; _dataService.Add(licenseMsg); _dataService.SaveChanges(); }