public List <Alert> GetAlertsByAccountID(Int32 AccountID) { List <Alert> result = new List <Alert>(); List <Alert> alerts = _alertRepository.GetAlertsByAccountID(AccountID); foreach (Alert alert in alerts) { foreach (string s in tags) { switch (s) { case "[rootUrl]": alert.Message = alert.Message.Replace("[rootUrl]", _webContext.RootUrl); result.Add(alert); break; } } } return(result); }