private void RemoveFeed(string urlOrId) { Command <GeekStreamModel> command; int feedId; if (Int32.TryParse(urlOrId, out feedId)) { command = new RemoveFeedByIdCommand(feedId); } else { command = new RemoveFeedByUrlCommand(urlOrId); } try { _geekStreamDb.Execute(command); Console.WriteLine("ok"); } catch (CommandAbortedException) { Console.WriteLine("no such feed"); } }
private void RemoveFeed(string urlOrId) { Command<GeekStreamModel> command; int feedId; if (Int32.TryParse(urlOrId, out feedId)) { command = new RemoveFeedByIdCommand(feedId); } else { command = new RemoveFeedByUrlCommand(urlOrId); } try { _geekStreamDb.Execute(command); Console.WriteLine("ok"); } catch (CommandAbortedException) { Console.WriteLine("no such feed"); } }