public void Save(CryptoTrigger trigger, long telegramUserId) { if (trigger == null) { throw new ArgumentNullException(nameof(trigger)); } switch (trigger) { case PriceCryptoTrigger priceTrigger: _triggerRepository.AddTrigger(priceTrigger, telegramUserId); break; } }
public void AddTrigger(string trigger) { TriggerDb triggerDb = new TriggerDb(); triggerDb.Trigger = trigger; triggerDb.Created = DateTime.Now; try { _triggerRepo.AddTrigger(triggerDb); } catch (Exception ex) { } }