public static TodoApp Default() { if (_defaultInstance == null) { ITodoRepository repo = new TodoApiRepository(); _defaultInstance = new TodoApp(repo); } return(_defaultInstance); }
public static int Main(string[] args) { var app = new CommandApp(); app.Configure(app => { app.AddCommand <AddCommand>("add"); app.AddCommand <ClearCommand>("clear"); app.AddCommand <RemoveCommand>("remove") .WithAlias("delete") .WithAlias("del"); app.AddCommand <ListCommand>("list"); }); int appStatus = app.Run(args); TodoApp.Default().Dispose(); return(appStatus); }
public TodoRenderer(TodoApp app) { this.app = app ?? throw new ArgumentNullException(nameof(app)); }